def install_features(): Feature.query.delete() features = [] for toggle in FeatureToggle: feature = Feature() feature.populate_from_dict({ 'description': toggle.value, 'name': toggle, 'is_active': True }) features.append(feature) PcObject.save(*features)
def test_returns_none_if_database_and_enum_are_consistent(self, app): # Given find_all_features = MagicMock() features = [] for feature_toggle in FeatureToggle: feature = Feature() feature.populate_from_dict({'name': feature_toggle}) features.append(feature) find_all_features.return_value = features # When / Then assert check_feature_consistency(find_all_features) is None