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
0fd0454a
Commit
0fd0454a
authored
Jan 06, 2014
by
Yuri Prezument
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Test for setting allow_none=True for nullable CharFields
parent
e1bbe9d5
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
0 deletions
+8
-0
rest_framework/tests/test_serializer.py
+8
-0
No files found.
rest_framework/tests/test_serializer.py
View file @
0fd0454a
...
@@ -1504,6 +1504,7 @@ class AttributeMappingOnAutogeneratedFieldsTests(TestCase):
...
@@ -1504,6 +1504,7 @@ class AttributeMappingOnAutogeneratedFieldsTests(TestCase):
image_field
=
models
.
ImageField
(
max_length
=
1024
,
blank
=
True
)
image_field
=
models
.
ImageField
(
max_length
=
1024
,
blank
=
True
)
slug_field
=
models
.
SlugField
(
max_length
=
1024
,
blank
=
True
)
slug_field
=
models
.
SlugField
(
max_length
=
1024
,
blank
=
True
)
url_field
=
models
.
URLField
(
max_length
=
1024
,
blank
=
True
)
url_field
=
models
.
URLField
(
max_length
=
1024
,
blank
=
True
)
nullable_char_field
=
models
.
CharField
(
max_length
=
1024
,
blank
=
True
,
null
=
True
)
class
AMOAFSerializer
(
serializers
.
ModelSerializer
):
class
AMOAFSerializer
(
serializers
.
ModelSerializer
):
class
Meta
:
class
Meta
:
...
@@ -1536,6 +1537,10 @@ class AttributeMappingOnAutogeneratedFieldsTests(TestCase):
...
@@ -1536,6 +1537,10 @@ class AttributeMappingOnAutogeneratedFieldsTests(TestCase):
'url_field'
:
[
'url_field'
:
[
(
'max_length'
,
1024
),
(
'max_length'
,
1024
),
],
],
'nullable_char_field'
:
[
(
'max_length'
,
1024
),
(
'allow_none'
,
True
),
],
}
}
def
field_test
(
self
,
field
):
def
field_test
(
self
,
field
):
...
@@ -1572,6 +1577,9 @@ class AttributeMappingOnAutogeneratedFieldsTests(TestCase):
...
@@ -1572,6 +1577,9 @@ class AttributeMappingOnAutogeneratedFieldsTests(TestCase):
def
test_url_field
(
self
):
def
test_url_field
(
self
):
self
.
field_test
(
'url_field'
)
self
.
field_test
(
'url_field'
)
def
test_nullable_char_field
(
self
):
self
.
field_test
(
'nullable_char_field'
)
class
DefaultValuesOnAutogeneratedFieldsTests
(
TestCase
):
class
DefaultValuesOnAutogeneratedFieldsTests
(
TestCase
):
...
...
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