Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
C
campaign
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
La Quadrature du Net
piphone
campaign
Commits
ae79abf4
Commit
ae79abf4
authored
Jan 09, 2017
by
okhin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Updating the tests with the title for argumentaries
parent
212fa044
Pipeline
#727
passed with stages
in 1 minute and 5 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
3 deletions
+5
-3
picampaign/campaign/test_serializers.py
picampaign/campaign/test_serializers.py
+2
-1
picampaign/campaign/test_views.py
picampaign/campaign/test_views.py
+3
-2
No files found.
picampaign/campaign/test_serializers.py
View file @
ae79abf4
...
...
@@ -21,9 +21,10 @@ class ArgumentarySerializerTest(TestCase):
Argumentary
.
objects
.
create
(
lang
=
'en'
,
text
=
'A pertinent argument'
,
title
=
'A title'
,
campaign
=
campaign
)
self
.
assertEqual
(
ArgumentarySerializer
(
Argumentary
.
objects
.
all
(),
many
=
True
).
data
,
[
OrderedDict
([(
'lang'
,
'en'
),
(
'text'
,
'A pertinent argument'
)])])
self
.
assertEqual
(
ArgumentarySerializer
(
Argumentary
.
objects
.
all
(),
many
=
True
).
data
,
[
OrderedDict
([(
'lang'
,
'en'
),
(
'text'
,
'A pertinent argument'
)
,
(
'title'
,
'A title'
)
])])
class
CampaignContactSerializerTest
(
TestCase
):
def
test_to_representation
(
self
):
...
...
picampaign/campaign/test_views.py
View file @
ae79abf4
...
...
@@ -19,6 +19,7 @@ class ViewSetTest(TestCase):
self
.
argumentary
=
Argumentary
.
objects
.
create
(
lang
=
'en'
,
text
=
'A pertinent argument'
,
title
=
'A title'
,
campaign
=
self
.
campaign
)
self
.
contact
=
Contact
.
objects
.
create
(
...
...
@@ -52,8 +53,8 @@ class ViewSetTest(TestCase):
client
=
APIClient
()
response
=
client
.
get
(
'/campaigns/%(cid)d/arguments/'
%
{
'cid'
:
self
.
campaign
.
id
},
format
=
'json'
)
self
.
assertEqual
(
response
.
status_code
,
200
)
self
.
assertEqual
(
response
.
content
,
b
'[{"lang":"en","text":"A pertinent argument"}]'
)
self
.
assertEqual
(
response
.
content
,
b
'[{"lang":"en","text":"A pertinent argument"
,"title":"A title"
}]'
)
response
=
client
.
get
(
'/campaigns/%(cid)d/arguments/%(lang)s/'
%
{
'cid'
:
self
.
campaign
.
id
,
'lang'
:
self
.
argumentary
.
lang
},
format
=
'json'
)
self
.
assertEqual
(
response
.
status_code
,
200
)
self
.
assertEqual
(
response
.
content
,
b
'{"lang":"en","text":"A pertinent argument"}'
)
self
.
assertEqual
(
response
.
content
,
b
'{"lang":"en","text":"A pertinent argument"
,"title":"A title"
}'
)
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