From fbfa302d96dbb5687b5a1188e34cf59cf92def71 Mon Sep 17 00:00:00 2001 From: Kelvin Muchiri Date: Thu, 6 Jun 2024 16:32:31 +0300 Subject: [PATCH] fix failing test --- onadata/apps/logger/tests/models/test_entity.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/onadata/apps/logger/tests/models/test_entity.py b/onadata/apps/logger/tests/models/test_entity.py index 868f0288f0..e4c4a947e9 100644 --- a/onadata/apps/logger/tests/models/test_entity.py +++ b/onadata/apps/logger/tests/models/test_entity.py @@ -6,6 +6,7 @@ from onadata.apps.logger.models import Entity, EntityHistory, EntityList, Instance from onadata.apps.main.tests.test_base import TestBase +from onadata.libs.utils.user_auth import get_user_default_project class EntityTestCase(TestBase): @@ -14,7 +15,8 @@ class EntityTestCase(TestBase): def setUp(self): super().setUp() self.mocked_now = datetime(2023, 11, 8, 13, 17, 0, tzinfo=pytz.utc) - self.entity_list = EntityList.objects.first() + self.project = get_user_default_project(self.user) + self.entity_list = EntityList.objects.create(name="trees", project=self.project) @patch("django.utils.timezone.now") def test_creation(self, mock_now):