Ticket #27538: 27538-test.diff

File 27538-test.diff, 642 bytes (added by Tim Graham, 8 years ago)
  • tests/postgres_tests/test_json.py

    diff --git a/tests/postgres_tests/test_json.py b/tests/postgres_tests/test_json.py
    index 1978552..acbebdd 100644
    a b class TestSaveLoad(TestCase):  
    6565        loaded = JSONModel.objects.get()
    6666        self.assertEqual(loaded.field, 1)
    6767
     68    def test_dict(self):
     69        my_model = JSONModel.objects.create()
     70        my_model.field = {"foo": "bar"}
     71        my_model.save()
     72        my_model.refresh_from_db()
     73        self.assertEqual(my_model.field, {"foo": "bar"})
     74
    6875    def test_realistic_object(self):
    6976        obj = {
    7077            'a': 'b',
Back to Top