Example #1
0
 def test_disable_flag(self):
     FlagState.objects.create(
         name="DB_FLAG", condition="boolean", value="True"
     )
     self.assertFalse(flag_disabled("DB_FLAG"))
     disable_flag("DB_FLAG")
     self.assertTrue(flag_disabled("DB_FLAG"))
Example #2
0
 def test_disable_flag(self):
     FlagState.objects.create(name="DB_FLAG",
                              condition="boolean",
                              value="True")
     out = StringIO()
     self.assertFalse(flag_disabled("DB_FLAG"))
     call_command("disable_flag", "DB_FLAG", stdout=out)
     self.assertTrue(flag_disabled("DB_FLAG"))
     self.assertIn("Successfully disabled", out.getvalue())
Example #3
0
 def test_flag_disabled_global_enabled(self):
     """Global flags enabled should be False"""
     self.assertFalse(flag_disabled("FLAG_ENABLED"))
Example #4
0
 def test_flag_disabled_global_disabled(self):
     """Global flags disabled should be True"""
     self.assertTrue(flag_disabled("FLAG_DISABLED"))