File tree Expand file tree Collapse file tree 1 file changed +14
-1
lines changed Expand file tree Collapse file tree 1 file changed +14
-1
lines changed Original file line number Diff line number Diff line change @@ -29,6 +29,19 @@ def remove_all_role_mappings():
29
29
RoleMapping .objects .all ().delete ()
30
30
31
31
32
+ class TestUtilsMixin :
33
+ def _patch_project (self , project , attribute , value ):
34
+ old_value = getattr (project , attribute , None )
35
+ setattr (project , attribute , value )
36
+ project .save ()
37
+
38
+ def cleanup_project ():
39
+ setattr (project , attribute , old_value )
40
+ project .save ()
41
+
42
+ self .addCleanup (cleanup_project )
43
+
44
+
32
45
@override_settings (STATICFILES_STORAGE = 'django.contrib.staticfiles.storage.StaticFilesStorage' )
33
46
class TestProjectListAPI (APITestCase ):
34
47
@@ -604,7 +617,7 @@ def doCleanups(cls):
604
617
remove_all_role_mappings ()
605
618
606
619
607
- class TestAnnotationListAPI (APITestCase ):
620
+ class TestAnnotationListAPI (APITestCase , TestUtilsMixin ):
608
621
609
622
@classmethod
610
623
def setUpTestData (cls ):
You can’t perform that action at this time.
0 commit comments