def canonical_json(self): # Avoid circular import from normandy.recipes.api.v1.serializers import MinimalRecipeSerializer data = MinimalRecipeSerializer(self).data return CanonicalJSONRenderer().render(data)
def canonical_json(self): from normandy.recipes.api.serializers import RecipeSerializer # Avoid circular import data = RecipeSerializer(self).data return CanonicalJSONRenderer().render(data)
def test_it_works(self): data = {'a': 1, 'b': 2} rendered = CanonicalJSONRenderer().render(data) assert rendered == b'{"a":1,"b":2}'