From 0f4f6ec362d7e45837fcf0a4d01c9fe0988a70cd Mon Sep 17 00:00:00 2001 From: csae8092 Date: Tue, 19 Dec 2023 12:49:44 +0100 Subject: [PATCH] delete person test --- apis_core/apis_entities/tests.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/apis_core/apis_entities/tests.py b/apis_core/apis_entities/tests.py index b745d0a..0185d8b 100644 --- a/apis_core/apis_entities/tests.py +++ b/apis_core/apis_entities/tests.py @@ -7,6 +7,7 @@ client = Client() USER = {"username": "testuser", "password": "somepassword"} +BAHR = {"name": "Bahr", "first_name": "Hermann", "start_date_written": "1900"} class EntitiesTestCase(TestCase): @@ -28,8 +29,11 @@ def test_002_check_fixtures(self): self.assertEqual(items, 2) def test_003_create_person(self): - item, created = Person.objects.get_or_create( - **{"name": "Bahr", "first_name": "Hermann", "start_date_written": "1900"} - ) + item, created = Person.objects.get_or_create(**BAHR) self.assertTrue(created) self.assertEqual(item.name, "Bahr") + + def test_004_delete_person(self): + item, _ = Person.objects.get_or_create(**BAHR) + self.assertEqual(item.name, "Bahr") + item.delete()