コード例 #1
0
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)
コード例 #2
0
    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