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"))
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())
def test_flag_disabled_global_enabled(self): """Global flags enabled should be False""" self.assertFalse(flag_disabled("FLAG_ENABLED"))
def test_flag_disabled_global_disabled(self): """Global flags disabled should be True""" self.assertTrue(flag_disabled("FLAG_DISABLED"))