django-rest-framework/tests/test_serializer_empty.py

16 lines
491 B
Python
Raw Normal View History

2014-09-03 19:34:09 +04:00
# from django.test import TestCase
# from rest_framework import serializers
2014-09-03 19:34:09 +04:00
# class EmptySerializerTestCase(TestCase):
# def test_empty_serializer(self):
# class FooBarSerializer(serializers.Serializer):
# foo = serializers.IntegerField()
2014-09-12 12:12:56 +04:00
# bar = serializers.SerializerMethodField()
2014-09-03 19:34:09 +04:00
# def get_bar(self, obj):
# return 'bar'
2014-09-03 19:34:09 +04:00
# serializer = FooBarSerializer()
# self.assertEquals(serializer.data, {'foo': 0})