MCPcopy
hub / github.com/django/django / test_create

Method test_create

tests/get_or_create/tests.py:310–319  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

308 self.assertEqual(p.birthday, date(1940, 10, 10))
309
310 def test_create(self):
311 p, created = Person.objects.update_or_create(
312 first_name="John",
313 last_name="Lennon",
314 defaults={"birthday": date(1940, 10, 10)},
315 )
316 self.assertTrue(created)
317 self.assertEqual(p.first_name, "John")
318 self.assertEqual(p.last_name, "Lennon")
319 self.assertEqual(p.birthday, date(1940, 10, 10))
320
321 def test_create_twice(self):
322 p, created = Person.objects.update_or_create(

Callers

nothing calls this directly

Calls 2

dateFunction · 0.85
update_or_createMethod · 0.45

Tested by

no test coverage detected