Coverage for tests/django_tests/db/histories/test_special_history.py: 100%

15 statements  

« prev     ^ index     » next       coverage.py v7.4.3, created at 2024-03-12 13:49 +0000

1from django_napse.core.models import SpaceHistory 

2from django_napse.utils.model_test_case import ModelTestCase 

3 

4""" 

5python tests/test_app/manage.py test tests.django_tests.db.histories -v2 --keepdb --parallel 

6""" 

7 

8 

9class SpecialHistoryTestCase: 

10 model = SpaceHistory 

11 

12 def simple_create(self): 

13 return self.model.objects.create(owner=self.space) 

14 

15 def test_owner(self): 

16 self.assertEqual(self.simple_create().owner, self.space) 

17 

18 def test_get_or_create(self): 

19 history1 = self.model.get_or_create(self.space) 

20 history2 = self.model.get_or_create(self.space) 

21 self.assertEqual(history1, history2) 

22 

23 

24class SpecialHistoryBINANCETestCase(SpecialHistoryTestCase, ModelTestCase): 

25 exchange = "BINANCE"