2014-09-03 19:34:09 +04:00
|
|
|
# from django.test import TestCase
|
|
|
|
# from rest_framework import serializers
|
2013-10-10 20:33:22 +04:00
|
|
|
|
|
|
|
|
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()
|
2013-10-10 20:33:22 +04:00
|
|
|
|
2014-09-03 19:34:09 +04:00
|
|
|
# def get_bar(self, obj):
|
|
|
|
# return 'bar'
|
2013-10-10 20:33:22 +04:00
|
|
|
|
2014-09-03 19:34:09 +04:00
|
|
|
# serializer = FooBarSerializer()
|
|
|
|
# self.assertEquals(serializer.data, {'foo': 0})
|