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-12 12:12:56 +04:00
|
|
|
# bar = serializers.SerializerMethodField()
|
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})
|