Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
D
django-rest-framework
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
edx
django-rest-framework
Commits
aa7ed316
Commit
aa7ed316
authored
Feb 19, 2015
by
Aider Ibragimov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Return UniquenessTogetherModel to previous state
parent
fe8d95f9
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
5 deletions
+5
-5
tests/test_validators.py
+5
-5
No files found.
tests/test_validators.py
View file @
aa7ed316
...
...
@@ -76,8 +76,8 @@ class TestUniquenessValidation(TestCase):
# -----------------------------------
class
UniquenessTogetherModel
(
models
.
Model
):
race_name
=
models
.
CharField
(
max_length
=
100
,
null
=
True
)
position
=
models
.
IntegerField
(
null
=
True
)
race_name
=
models
.
CharField
(
max_length
=
100
)
position
=
models
.
IntegerField
()
class
Meta
:
unique_together
=
(
'race_name'
,
'position'
)
...
...
@@ -134,8 +134,8 @@ class TestUniquenessTogetherValidation(TestCase):
expected
=
dedent
(
"""
UniquenessTogetherSerializer():
id = IntegerField(label='ID', read_only=True)
race_name = CharField(
allow_null=True,
max_length=100, required=True)
position = IntegerField(
allow_null=True,
required=True)
race_name = CharField(max_length=100, required=True)
position = IntegerField(required=True)
class Meta:
validators = [<UniqueTogetherValidator(queryset=UniquenessTogetherModel.objects.all(), fields=('race_name', 'position'))>]
"""
)
...
...
@@ -204,7 +204,7 @@ class TestUniquenessTogetherValidation(TestCase):
expected
=
dedent
(
"""
ExcludedFieldSerializer():
id = IntegerField(label='ID', read_only=True)
race_name = CharField(
allow_null=True, max_length=100, required=False
)
race_name = CharField(
max_length=100
)
"""
)
assert
repr
(
serializer
)
==
expected
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment