[Python-modules-commits] r30116 - in packages/django-filter/trunk/debian (4 files)

bam at users.alioth.debian.org bam at users.alioth.debian.org
Mon Aug 11 00:09:18 UTC 2014


    Date: Monday, August 11, 2014 @ 00:09:17
  Author: bam
Revision: 30116

Fix tests with Django 1.7.

Added:
  packages/django-filter/trunk/debian/patches/
  packages/django-filter/trunk/debian/patches/fix_django1.7
  packages/django-filter/trunk/debian/patches/series
Modified:
  packages/django-filter/trunk/debian/changelog

Modified: packages/django-filter/trunk/debian/changelog
===================================================================
--- packages/django-filter/trunk/debian/changelog	2014-08-10 23:47:24 UTC (rev 30115)
+++ packages/django-filter/trunk/debian/changelog	2014-08-11 00:09:17 UTC (rev 30116)
@@ -1,3 +1,9 @@
+django-filter (0.7-4) unstable; urgency=low
+
+  * Add patch to fix tests in Django 1.7. Closes: #755635.
+
+ -- Brian May <bam at debian.org>  Mon, 11 Aug 2014 10:05:52 +1000
+
 django-filter (0.7-3) unstable; urgency=low
 
   * Python3 package.

Added: packages/django-filter/trunk/debian/patches/fix_django1.7
===================================================================
--- packages/django-filter/trunk/debian/patches/fix_django1.7	                        (rev 0)
+++ packages/django-filter/trunk/debian/patches/fix_django1.7	2014-08-11 00:09:17 UTC (rev 30116)
@@ -0,0 +1,66 @@
+Index: django-filter/tests/models.py
+===================================================================
+--- django-filter.orig/tests/models.py	2013-08-10 20:35:09.000000000 +1000
++++ django-filter/tests/models.py	2014-08-11 10:00:33.823184110 +1000
+@@ -1,5 +1,6 @@
+ from __future__ import absolute_import
+ from __future__ import unicode_literals
++from django.utils.encoding import python_2_unicode_compatible
+ 
+ ### these models are for testing
+ from django import forms
+@@ -38,6 +39,7 @@
+         return super(SubnetMaskField, self).formfield(**defaults)
+ 
+ 
++ at python_2_unicode_compatible
+ class User(models.Model):
+     username = models.CharField(max_length=255)
+     first_name = SubCharField(max_length=100)
+@@ -49,18 +51,20 @@
+ 
+     favorite_books = models.ManyToManyField('Book', related_name='lovers')
+ 
+-    def __unicode__(self):
++    def __str__(self):
+         return self.username
+ 
+ 
++ at python_2_unicode_compatible
+ class AdminUser(User):
+     class Meta:
+         proxy = True
+ 
+-    def __unicode__(self):
++    def __str__(self):
+         return "%s (ADMIN)" % self.username
+ 
+ 
++ at python_2_unicode_compatible
+ class Comment(models.Model):
+     text = models.TextField()
+     author = models.ForeignKey(User, related_name='comments')
+@@ -68,7 +72,7 @@
+     date = models.DateField()
+     time = models.TimeField()
+ 
+-    def __unicode__(self):
++    def __str__(self):
+         return "%s said %s" % (self.author, self.text[:25])
+ 
+ 
+@@ -77,12 +81,13 @@
+     author = models.ForeignKey(User, null=True)
+ 
+ 
++ at python_2_unicode_compatible
+ class Book(models.Model):
+     title = models.CharField(max_length=100)
+     price = models.DecimalField(max_digits=6, decimal_places=2)
+     average_rating = models.FloatField()
+ 
+-    def __unicode__(self):
++    def __str__(self):
+         return self.title
+ 
+ 

Added: packages/django-filter/trunk/debian/patches/series
===================================================================
--- packages/django-filter/trunk/debian/patches/series	                        (rev 0)
+++ packages/django-filter/trunk/debian/patches/series	2014-08-11 00:09:17 UTC (rev 30116)
@@ -0,0 +1 @@
+fix_django1.7




More information about the Python-modules-commits mailing list