django-rest-framework/tests/test_serializer_empty.py

16 lines
481 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-09 20:46:28 +04:00
# bar = serializers.MethodField()
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})