[Python-modules-commits] r29630 - in packages/python-django-jsonfield/trunk/debian (4 files)

bam at users.alioth.debian.org bam at users.alioth.debian.org
Sat Jul 5 02:10:37 UTC 2014


    Date: Saturday, July 5, 2014 @ 02:10:36
  Author: bam
Revision: 29630

Use correct upstream package.

The following packages are not the same.

https://pypi.python.org/pypi/django-jsonfield/0.9.12
https://pypi.python.org/pypi/jsonfield/0.9.20

For now, we are the django-jsonfield package, not the jsonfield package.

Added:
  packages/python-django-jsonfield/trunk/debian/patches/
  packages/python-django-jsonfield/trunk/debian/patches/fix_tests_python3
  packages/python-django-jsonfield/trunk/debian/patches/series
Modified:
  packages/python-django-jsonfield/trunk/debian/changelog

Modified: packages/python-django-jsonfield/trunk/debian/changelog
===================================================================
--- packages/python-django-jsonfield/trunk/debian/changelog	2014-07-05 00:15:08 UTC (rev 29629)
+++ packages/python-django-jsonfield/trunk/debian/changelog	2014-07-05 02:10:36 UTC (rev 29630)
@@ -1,7 +1,6 @@
-python-django-jsonfield (0.9.20-1) unstable; urgency=low
+python-django-jsonfield (0.9.12-3) unstable; urgency=low
 
-  * New upstream version. Closes: #753462.
-  * Python3 package.
+  * Python3 package. Closes: #753462.
 
  -- Brian May <bam at debian.org>  Wed, 02 Jul 2014 16:15:14 +1000
 

Added: packages/python-django-jsonfield/trunk/debian/patches/fix_tests_python3
===================================================================
--- packages/python-django-jsonfield/trunk/debian/patches/fix_tests_python3	                        (rev 0)
+++ packages/python-django-jsonfield/trunk/debian/patches/fix_tests_python3	2014-07-05 02:10:36 UTC (rev 29630)
@@ -0,0 +1,229 @@
+Index: python-django-jsonfield/jsonfield/tests/test_fields.py
+===================================================================
+--- python-django-jsonfield.orig/jsonfield/tests/test_fields.py	2013-12-10 10:23:00.000000000 +1100
++++ python-django-jsonfield/jsonfield/tests/test_fields.py	2014-07-05 11:02:36.877022130 +1000
+@@ -12,11 +12,11 @@
+         obj = JSONFieldTestModel(json='''{
+             "spam": "eggs"
+         }''')
+-        self.assertEquals(obj.json, {'spam':'eggs'})
++        self.assertEqual(obj.json, {'spam':'eggs'})
+ 
+     def test_json_field_empty(self):
+         obj = JSONFieldTestModel(json='')
+-        self.assertEquals(obj.json, None)
++        self.assertEqual(obj.json, None)
+ 
+     def test_json_field_save(self):
+         JSONFieldTestModel.objects.create(
+@@ -26,18 +26,18 @@
+             }''',
+         )
+         obj2 = JSONFieldTestModel.objects.get(id=10)
+-        self.assertEquals(obj2.json, {'spam':'eggs'})
++        self.assertEqual(obj2.json, {'spam':'eggs'})
+ 
+     def test_json_field_save_empty(self):
+         JSONFieldTestModel.objects.create(id=10, json='')
+         obj2 = JSONFieldTestModel.objects.get(id=10)
+-        self.assertEquals(obj2.json, None)
++        self.assertEqual(obj2.json, None)
+ 
+     def test_db_prep_save(self):
+         field = JSONField("test")
+         field.set_attributes_from_name("json")
+-        self.assertEquals(None, field.get_db_prep_save(None, connection=None))
+-        self.assertEquals('{"spam": "eggs"}', field.get_db_prep_save({"spam": "eggs"}, connection=None))
++        self.assertEqual(None, field.get_db_prep_save(None, connection=None))
++        self.assertEqual('{"spam": "eggs"}', field.get_db_prep_save({"spam": "eggs"}, connection=None))
+ 
+     def test_formfield(self):
+         from jsonfield.forms import JSONFormField
+@@ -45,8 +45,8 @@
+         field = JSONField("test")
+         field.set_attributes_from_name("json")
+         formfield = field.formfield()
+-        self.assertEquals(type(formfield), JSONFormField)
+-        self.assertEquals(type(formfield.widget), JSONWidget)
++        self.assertEqual(type(formfield), JSONFormField)
++        self.assertEqual(type(formfield.widget), JSONWidget)
+ 
+     def test_formfield_clean_blank(self):
+         field = JSONField("test")
+@@ -61,42 +61,42 @@
+     def test_formfield_null_and_blank_clean_blank(self):
+         field = JSONField("test", null=True, blank=True)
+         formfield = field.formfield()
+-        self.assertEquals(formfield.clean(value=''), '')
++        self.assertEqual(formfield.clean(value=''), '')
+ 
+     def test_formfield_null_and_blank_clean_none(self):
+         field = JSONField("test", null=True, blank=True)
+         formfield = field.formfield()
+-        self.assertEquals(formfield.clean(value=None), None)
++        self.assertEqual(formfield.clean(value=None), None)
+ 
+     def test_formfield_blank_clean_blank(self):
+         field = JSONField("test", null=False, blank=True)
+         formfield = field.formfield()
+-        self.assertEquals(formfield.clean(value=''), '')
++        self.assertEqual(formfield.clean(value=''), '')
+ 
+     def test_formfield_blank_clean_none(self):
+         # Hmm, I'm not sure how to do this. What happens if we pass a
+         # None to a field that has null=False?
+         field = JSONField("test", null=False, blank=True)
+         formfield = field.formfield()
+-        self.assertEquals(formfield.clean(value=None), None)
++        self.assertEqual(formfield.clean(value=None), None)
+ 
+     def test_default_value(self):
+         obj = JSONFieldWithDefaultTestModel.objects.create()
+         obj = JSONFieldWithDefaultTestModel.objects.get(id=obj.id)
+-        self.assertEquals(obj.json, {'sukasuka': 'YAAAAAZ'})
++        self.assertEqual(obj.json, {'sukasuka': 'YAAAAAZ'})
+ 
+     def test_query_object(self):
+         JSONFieldTestModel.objects.create(json={})
+         JSONFieldTestModel.objects.create(json={'foo':'bar'})
+-        self.assertEquals(2, JSONFieldTestModel.objects.all().count())
+-        self.assertEquals(1, JSONFieldTestModel.objects.exclude(json={}).count())
+-        self.assertEquals(1, JSONFieldTestModel.objects.filter(json={}).count())
+-        self.assertEquals(1, JSONFieldTestModel.objects.filter(json={'foo':'bar'}).count())
+-        self.assertEquals(1, JSONFieldTestModel.objects.filter(json__contains={'foo':'bar'}).count())
++        self.assertEqual(2, JSONFieldTestModel.objects.all().count())
++        self.assertEqual(1, JSONFieldTestModel.objects.exclude(json={}).count())
++        self.assertEqual(1, JSONFieldTestModel.objects.filter(json={}).count())
++        self.assertEqual(1, JSONFieldTestModel.objects.filter(json={'foo':'bar'}).count())
++        self.assertEqual(1, JSONFieldTestModel.objects.filter(json__contains={'foo':'bar'}).count())
+         JSONFieldTestModel.objects.create(json={'foo':'bar', 'baz':'bing'})
+-        self.assertEquals(2, JSONFieldTestModel.objects.filter(json__contains={'foo':'bar'}).count())
+-        self.assertEquals(1, JSONFieldTestModel.objects.filter(json__contains={'baz':'bing', 'foo':'bar'}).count())
+-        self.assertEquals(2, JSONFieldTestModel.objects.filter(json__contains='foo').count())
++        self.assertEqual(2, JSONFieldTestModel.objects.filter(json__contains={'foo':'bar'}).count())
++        self.assertEqual(1, JSONFieldTestModel.objects.filter(json__contains={'baz':'bing', 'foo':'bar'}).count())
++        self.assertEqual(2, JSONFieldTestModel.objects.filter(json__contains='foo').count())
+         # This code needs to be implemented!
+         self.assertRaises(TypeError, lambda:JSONFieldTestModel.objects.filter(json__contains=['baz', 'foo']))
+ 
+@@ -105,28 +105,28 @@
+         JSONFieldTestModel.objects.create(json={})
+         JSONFieldTestModel.objects.create(json={'foo':'bar'})
+ 
+-        self.assertEquals(1, JSONFieldTestModel.objects.filter(json=None).count())
+-        self.assertEquals(None, JSONFieldTestModel.objects.get(json=None).json)
++        self.assertEqual(1, JSONFieldTestModel.objects.filter(json=None).count())
++        self.assertEqual(None, JSONFieldTestModel.objects.get(json=None).json)
+ 
+     def test_jsonfield_blank(self):
+         BlankJSONFieldTestModel.objects.create(blank_json='', null_json=None)
+         obj = BlankJSONFieldTestModel.objects.get()
+-        self.assertEquals(None, obj.null_json)
+-        self.assertEquals("", obj.blank_json)
++        self.assertEqual(None, obj.null_json)
++        self.assertEqual("", obj.blank_json)
+         obj.save()
+         obj = BlankJSONFieldTestModel.objects.get()
+-        self.assertEquals(None, obj.null_json)
+-        self.assertEquals("", obj.blank_json)
++        self.assertEqual(None, obj.null_json)
++        self.assertEqual("", obj.blank_json)
+ 
+     def test_callable_default(self):
+         CallableDefaultModel.objects.create()
+         obj = CallableDefaultModel.objects.get()
+-        self.assertEquals({'x':2}, obj.json)
++        self.assertEqual({'x':2}, obj.json)
+ 
+     def test_callable_default_overridden(self):
+         CallableDefaultModel.objects.create(json={'x':3})
+         obj = CallableDefaultModel.objects.get()
+-        self.assertEquals({'x':3}, obj.json)
++        self.assertEqual({'x':3}, obj.json)
+ 
+     def test_mutable_default_checking(self):
+         obj1 = JSONFieldWithDefaultTestModel()
+@@ -149,5 +149,5 @@
+ class SavingModelsTest(DjangoTestCase):
+     def test_saving_null(self):
+         obj = BlankJSONFieldTestModel.objects.create(blank_json='', null_json=None)
+-        self.assertEquals('', obj.blank_json)
+-        self.assertEquals(None, obj.null_json)
+\ No newline at end of file
++        self.assertEqual('', obj.blank_json)
++        self.assertEqual(None, obj.null_json)
+Index: python-django-jsonfield/jsonfield/tests/test_forms.py
+===================================================================
+--- python-django-jsonfield.orig/jsonfield/tests/test_forms.py	2013-12-10 10:28:24.000000000 +1100
++++ python-django-jsonfield/jsonfield/tests/test_forms.py	2014-07-05 11:15:27.259803525 +1000
+@@ -1,5 +1,5 @@
+ from django.test import TestCase as DjangoTestCase
+-from django.utils import unittest
++from django.utils import unittest, six
+ from django.forms import ValidationError
+ 
+ from jsonfield.forms import JSONFormField
+@@ -8,26 +8,26 @@
+ class JSONFormFieldTest(DjangoTestCase):
+     def test_form_field_clean_empty_object(self):
+         field = JSONFormField(required=False)
+-        self.assertEquals({}, field.clean('{}'))
++        self.assertEqual({}, field.clean('{}'))
+         
+     def test_form_field_clean_object(self):
+         field = JSONFormField(required=False)
+-        self.assertEquals(
++        self.assertEqual(
+             {'foo':'bar', 'baz':2},
+             field.clean('{"foo":"bar","baz":2}')
+         )
+     
+     def test_form_field_clean_empty_array(self):
+         field = JSONFormField(required=False)
+-        self.assertEquals([],field.clean('[]'))
++        self.assertEqual([],field.clean('[]'))
+     
+     def test_required_form_field_array(self):
+         field = JSONFormField(required=True)
+-        self.assertEquals([], field.clean('[]'))
++        self.assertEqual([], field.clean('[]'))
+         
+     def test_required_form_field_object(self):
+         field = JSONFormField(required=True)
+-        self.assertEquals({}, field.clean('{}'))
++        self.assertEqual({}, field.clean('{}'))
+     
+     def test_required_form_field_empty(self):
+         field = JSONFormField(required=True)
+@@ -48,9 +48,9 @@
+ 
+ class JSONFormMultipleSelectFieldTest(DjangoTestCase):
+     def test_multiple_select_data(self):
+-        form = JSONTestForm({'json_data': [u'SA', u'WA']})
++        form = JSONTestForm({'json_data': [six.u('SA'), six.u('WA')]})
+         assert form.is_valid()
+         
+-        self.assertEquals([u'SA', u'WA'], form.cleaned_data['json_data'])
++        self.assertEqual([six.u('SA'), six.u('WA')], form.cleaned_data['json_data'])
+ 
+ 
+Index: python-django-jsonfield/jsonfield/forms.py
+===================================================================
+--- python-django-jsonfield.orig/jsonfield/forms.py	2013-12-10 10:21:30.000000000 +1100
++++ python-django-jsonfield/jsonfield/forms.py	2014-07-05 11:09:53.495263384 +1000
+@@ -20,7 +20,7 @@
+                 return json.loads(value)
+             except Exception as exc:
+                 raise forms.ValidationError(
+-                    'JSON decode error: %s' % (unicode(exc),)
++                    'JSON decode error: %s' % (six.text_type(exc),)
+                 )
+         else:
+             return value
+@@ -28,4 +28,4 @@
+     def validate(self, value):
+         # This is required in older django versions.
+         if value in self.empty_values and self.required:
+-            raise forms.ValidationError(self.error_messages['required'], code='required')
+\ No newline at end of file
++            raise forms.ValidationError(self.error_messages['required'], code='required')

Added: packages/python-django-jsonfield/trunk/debian/patches/series
===================================================================
--- packages/python-django-jsonfield/trunk/debian/patches/series	                        (rev 0)
+++ packages/python-django-jsonfield/trunk/debian/patches/series	2014-07-05 02:10:36 UTC (rev 29630)
@@ -0,0 +1 @@
+fix_tests_python3




More information about the Python-modules-commits mailing list