summaryrefslogtreecommitdiff
path: root/tests/distinct_on_fields
diff options
context:
space:
mode:
authorJason Myers <jason@jasonamyers.com>2013-11-02 23:36:09 -0500
committerJason Myers <jason@jasonamyers.com>2013-11-02 23:50:49 -0500
commit7a61c68c50d3837c50e35c252fd76220f08b5290 (patch)
tree586f16a3f02c2b45ffb3dd2af834c0ef604e099c /tests/distinct_on_fields
parent0fdb692c6c94d912f17a3e2ad12413fb072d38ec (diff)
downloaddjango-7a61c68c50d3837c50e35c252fd76220f08b5290.tar.gz
PEP8 cleanup
Signed-off-by: Jason Myers <jason@jasonamyers.com>
Diffstat (limited to 'tests/distinct_on_fields')
-rw-r--r--tests/distinct_on_fields/models.py5
-rw-r--r--tests/distinct_on_fields/tests.py3
2 files changed, 7 insertions, 1 deletions
diff --git a/tests/distinct_on_fields/models.py b/tests/distinct_on_fields/models.py
index 7982f435d0..053fd9cc5f 100644
--- a/tests/distinct_on_fields/models.py
+++ b/tests/distinct_on_fields/models.py
@@ -3,6 +3,7 @@ from __future__ import unicode_literals
from django.db import models
from django.utils.encoding import python_2_unicode_compatible
+
@python_2_unicode_compatible
class Tag(models.Model):
name = models.CharField(max_length=10)
@@ -15,6 +16,7 @@ class Tag(models.Model):
def __str__(self):
return self.name
+
@python_2_unicode_compatible
class Celebrity(models.Model):
name = models.CharField("Name", max_length=20)
@@ -23,9 +25,11 @@ class Celebrity(models.Model):
def __str__(self):
return self.name
+
class Fan(models.Model):
fan_of = models.ForeignKey(Celebrity)
+
@python_2_unicode_compatible
class Staff(models.Model):
id = models.IntegerField(primary_key=True)
@@ -37,6 +41,7 @@ class Staff(models.Model):
def __str__(self):
return self.name
+
@python_2_unicode_compatible
class StaffTag(models.Model):
staff = models.ForeignKey(Staff)
diff --git a/tests/distinct_on_fields/tests.py b/tests/distinct_on_fields/tests.py
index e14f06f2ed..9dedd98f81 100644
--- a/tests/distinct_on_fields/tests.py
+++ b/tests/distinct_on_fields/tests.py
@@ -6,6 +6,7 @@ from django.test.utils import str_prefix
from .models import Tag, Celebrity, Fan, Staff, StaffTag
+
@skipUnlessDBFeature('can_distinct_on_fields')
class DistinctOnTests(TestCase):
def setUp(self):
@@ -77,7 +78,7 @@ class DistinctOnTests(TestCase):
# Fetch the alphabetically first coworker for each worker
(
(Staff.objects.distinct('id').order_by('id', 'coworkers__name').
- values_list('id', 'coworkers__name')),
+ values_list('id', 'coworkers__name')),
[str_prefix("(1, %(_)s'p2')"), str_prefix("(2, %(_)s'p1')"),
str_prefix("(3, %(_)s'p1')"), "(4, None)"]
),