mirror of
https://github.com/encode/django-rest-framework.git
synced 2025-02-03 21:24:33 +03:00
Test for serialitation of dictionaries with keys that collide with
dictionary method names
This commit is contained in:
parent
39d9ac9d1b
commit
cc7a77c477
|
@ -40,6 +40,12 @@ class TestObjectToData(TestCase):
|
||||||
now = datetime.datetime.now()
|
now = datetime.datetime.now()
|
||||||
self.assertEquals(self.serialize(now), now)
|
self.assertEquals(self.serialize(now), now)
|
||||||
|
|
||||||
|
def test_dict_method_name_collision(self):
|
||||||
|
"""dict with key that collides with dict method name"""
|
||||||
|
self.assertEquals(self.serialize({'items': 'foo'}), {'items': u'foo'})
|
||||||
|
self.assertEquals(self.serialize({'keys': 'foo'}), {'keys': u'foo'})
|
||||||
|
self.assertEquals(self.serialize({'values': 'foo'}), {'values': u'foo'})
|
||||||
|
|
||||||
|
|
||||||
class TestFieldNesting(TestCase):
|
class TestFieldNesting(TestCase):
|
||||||
"""
|
"""
|
||||||
|
|
Loading…
Reference in New Issue
Block a user