From 55878be35c843bf3f216a2cf76c80a3395ca31fd Mon Sep 17 00:00:00 2001 From: David Fischer Date: Wed, 26 Nov 2014 16:42:31 +0100 Subject: [PATCH 1/2] Set Python scripts as executable --- runtests.py | 1 + setup.py | 2 ++ 2 files changed, 3 insertions(+) mode change 100644 => 100755 runtests.py mode change 100644 => 100755 setup.py diff --git a/runtests.py b/runtests.py old mode 100644 new mode 100755 index 6c186bb..a6a917e --- a/runtests.py +++ b/runtests.py @@ -1,3 +1,4 @@ +#!/usr/bin/env python # -*- coding: utf-8 -*- import os, sys diff --git a/setup.py b/setup.py old mode 100644 new mode 100755 index 25a2bae..1e11a8e --- a/setup.py +++ b/setup.py @@ -1,3 +1,5 @@ +#!/usr/bin/env python + from setuptools import setup, find_packages description=""" From 8add2b858f4bb67087920b1a431436c88f9b0edb Mon Sep 17 00:00:00 2001 From: David Fischer Date: Wed, 26 Nov 2014 16:43:21 +0100 Subject: [PATCH 2/2] Add unit-test to test dict with int keys --- tests/pg_json_fields/tests.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/tests/pg_json_fields/tests.py b/tests/pg_json_fields/tests.py index fb8f31c..04fb139 100644 --- a/tests/pg_json_fields/tests.py +++ b/tests/pg_json_fields/tests.py @@ -64,6 +64,11 @@ def test_primitives_null(self): obj = self.model_class.objects.get(pk=obj.pk) self.assertEqual(obj.data, None) + def test_dict_with_int_key(self): + obj = self.model_class.objects.create(data={10: 5}) + obj = self.model_class.objects.get(pk=obj.pk) + self.assertDictEqual(obj.data, {10: 5}) + def test_value_to_string_serializes_correctly(self): obj = self.model_class.objects.create(data={"a": 1})