[Python-modules-commits] r30389 - in packages/django-picklefield/trunk/debian (3 files)
fladi-guest at users.alioth.debian.org
fladi-guest at users.alioth.debian.org
Sun Aug 31 19:44:03 UTC 2014
Date: Sunday, August 31, 2014 @ 19:44:02
Author: fladi-guest
Revision: 30389
Add fix_tests.patch to correctly compare to different object instances with the same content.
Added:
packages/django-picklefield/trunk/debian/patches/
packages/django-picklefield/trunk/debian/patches/fix_tests.patch
packages/django-picklefield/trunk/debian/patches/series
Added: packages/django-picklefield/trunk/debian/patches/fix_tests.patch
===================================================================
--- packages/django-picklefield/trunk/debian/patches/fix_tests.patch (rev 0)
+++ packages/django-picklefield/trunk/debian/patches/fix_tests.patch 2014-08-31 19:44:02 UTC (rev 30389)
@@ -0,0 +1,21 @@
+Description: compare objects by fields not by instance
+ Upstream tests are comparing the original object directly with the deserialized
+ one. This fails because the default python comparison for objects uses their
+ identity which fails for two different object instances.
+ This patch does the comparison by field for both objects.
+Author: Michael Fladischer <FladischerMichael at fladi.at>
+Last-Update: 2014-08-29
+Forwarded: https://github.com/shrubberysoft/django-picklefield/pull/16
+
+--- a/src/picklefield/tests.py
++++ b/src/picklefield/tests.py
+@@ -167,5 +167,7 @@
+ 'fields': {"pickle_field": p}}])
+
+ for deserialized_test in serializers.deserialize('json', serialized):
+- self.assertEquals(deserialized_test.object,
+- model)
++ self.assertEquals(deserialized_test.object.pk,
++ model.pk)
++ self.assertEquals(deserialized_test.object.pickle_field,
++ model.pickle_field)
Added: packages/django-picklefield/trunk/debian/patches/series
===================================================================
--- packages/django-picklefield/trunk/debian/patches/series (rev 0)
+++ packages/django-picklefield/trunk/debian/patches/series 2014-08-31 19:44:02 UTC (rev 30389)
@@ -0,0 +1 @@
+fix_tests.patch
More information about the Python-modules-commits
mailing list