Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Cleaned up the ordering of test data from [5232].

git-svn-id: http://code.djangoproject.com/svn/django/trunk@5233 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
commit 9350945963a144f8ea2c25d95f3fc7d1e6fd4493 1 parent c38a93e
@freakboy3742 freakboy3742 authored
View
12 tests/regressiontests/serializers_regress/models.py
@@ -100,6 +100,12 @@ class Anchor(models.Model):
something for other models to point at"""
data = models.CharField(maxlength=30)
+
+class UniqueAnchor(models.Model):
+ """This is a model that can be used as
+ something for other models to point at"""
+
+ data = models.CharField(unique=True, maxlength=30)
class FKData(models.Model):
data = models.ForeignKey(Anchor, null=True)
@@ -117,12 +123,6 @@ class M2MSelfData(models.Model):
data = models.ManyToManyField('self', null=True, symmetrical=False)
-class UniqueAnchor(models.Model):
- """This is a model that can be used as
- something for other models to point at"""
-
- data = models.CharField(unique=True, maxlength=30)
-
class FKDataToField(models.Model):
data = models.ForeignKey(UniqueAnchor, null=True, to_field='data')
View
10 tests/regressiontests/serializers_regress/tests.py
@@ -159,6 +159,7 @@ def pk_compare(testcase, pk, klass, data):
(data_obj, 300, Anchor, "Anchor 1"),
(data_obj, 301, Anchor, "Anchor 2"),
+ (data_obj, 302, UniqueAnchor, "UAnchor 1"),
(fk_obj, 400, FKData, 300), # Post reference
(fk_obj, 401, FKData, 500), # Pre reference
@@ -184,14 +185,13 @@ def pk_compare(testcase, pk, klass, data):
(m2m_obj, 445, M2MSelfData, []),
(m2m_obj, 446, M2MSelfData, []),
- (data_obj, 450, UniqueAnchor, "UAnchor 1"),
- (fk_obj, 451, FKDataToField, "UAnchor 1"),
- (fk_obj, 452, FKDataToField, "UAnchor 2"),
- (fk_obj, 453, FKDataToField, None),
- (data_obj, 454, UniqueAnchor, "UAnchor 2"),
+ (fk_obj, 450, FKDataToField, "UAnchor 1"),
+ (fk_obj, 451, FKDataToField, "UAnchor 2"),
+ (fk_obj, 452, FKDataToField, None),
(data_obj, 500, Anchor, "Anchor 3"),
(data_obj, 501, Anchor, "Anchor 4"),
+ (data_obj, 502, UniqueAnchor, "UAnchor 2"),
(pk_obj, 601, BooleanPKData, True),
(pk_obj, 602, BooleanPKData, False),
Please sign in to comment.
Something went wrong with that request. Please try again.