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