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():
2929 RoleMapping .objects .all ().delete ()
3030
3131
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+
3245@override_settings (STATICFILES_STORAGE = 'django.contrib.staticfiles.storage.StaticFilesStorage' )
3346class TestProjectListAPI (APITestCase ):
3447
@@ -604,7 +617,7 @@ def doCleanups(cls):
604617 remove_all_role_mappings ()
605618
606619
607- class TestAnnotationListAPI (APITestCase ):
620+ class TestAnnotationListAPI (APITestCase , TestUtilsMixin ):
608621
609622 @classmethod
610623 def setUpTestData (cls ):
You can’t perform that action at this time.
0 commit comments