예제 #1
0
 def test_duplicate_global_flags(self):
     with self.assertRaises(DuplicateFlagException):
         add_flags_from_sources(sources=['flags.tests.test_settings'])
예제 #2
0
 def test_get_flags(self):
     add_flags_from_sources(sources=['flags.tests.test_settings'])
     self.assertIn('GLOBAL_FLAG', get_flags())
     self.assertIn('SOURCED_FLAG', get_flags())
예제 #3
0
 def test_add_flags_from_sources(self):
     add_flags_from_sources(sources=['flags.tests.test_settings'])
     self.assertTrue(flags.settings.SOURCED_FLAGS['SOURCED_FLAG'])
예제 #4
0
 def test_add_flags_from_sources_non_existent(self):
     with self.assertRaises(ImportError):
         add_flags_from_sources(sources=['non.existent.module'])
예제 #5
0
파일: apps.py 프로젝트: chosak/django-flags
 def ready(self):
     add_flags_from_sources()