Пример #1
0
    def test_features_from_json_file_overwrite_existing(self):
        Feature.objects.create(name='login', enabled=False)
        f = Feature.objects.get(name='login')
        self.assertEquals(f.enabled, False)
        
        load_features_from_json_file()

        f = Feature.objects.get(name='login')
        self.assertEquals(f.enabled, True)
Пример #2
0
    def test_load_features_from_json_file(self):
        load_features_from_json_file(self.file)
        features = Feature.objects.all()

        self.assertEquals(len(features), 2)

        feature = Feature.objects.get(name="login")
        self.assertEquals(feature.enabled, True)
        self.assertEquals(feature.description, "Login link")

        feature = Feature.objects.get(name="search")
        self.assertEquals(feature.enabled, False)
        self.assertEquals(feature.description, "Search box")