Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
N
nuages
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
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
etch
nuages
Commits
ecd81ad0
Commit
ecd81ad0
authored
Aug 26, 2014
by
Christophe Siraut
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Test date headers are shown
parent
425dd1e4
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
42 additions
and
33 deletions
+42
-33
meetingpoll/test_functional.py
meetingpoll/test_functional.py
+42
-0
nuages/test_functional.py
nuages/test_functional.py
+0
-33
No files found.
meetingpoll/test_functional.py
0 → 100644
View file @
ecd81ad0
#!/usr/bin/env python
from
django.core.urlresolvers
import
reverse
from
django_webtest
import
WebTest
from
meetingpoll.models
import
createId
from
nuages.test_factories
import
userFactory
,
pollFactory
class
MeetingPoll
(
WebTest
):
def
setUp
(
self
):
self
.
poll
=
pollFactory
()
def
test_is_displayed
(
self
):
response
=
self
.
app
.
get
(
self
.
poll
.
link
)
self
.
assertEqual
(
response
.
status_code
,
200
)
self
.
assertTrue
(
'form'
in
response
.
context
)
self
.
assertEqual
(
response
.
context
[
'object'
].
id
,
self
.
poll
.
id
)
def
test_404
(
self
):
response
=
self
.
app
.
get
(
'/%s/'
%
createId
(
5
),
status
=
404
)
self
.
assertEqual
(
response
.
status_code
,
404
)
def
test_creation
(
self
):
new
=
self
.
app
.
get
(
reverse
(
'new'
))
form
=
new
.
forms
[
0
]
form
[
'title'
]
=
'fake title'
form
[
'description'
]
=
'fake description'
edition
=
form
.
submit
().
follow
()
self
.
assertContains
(
edition
,
'Manage choices'
,
count
=
1
,
status_code
=
200
)
form
=
edition
.
forms
[
0
]
form
[
'choice_set-0-choice_0'
]
=
'06/06/2013 17:00'
form
[
'choice_set-0-details'
]
=
'fake detail'
votepage
=
form
.
submit
().
follow
()
form
=
votepage
.
forms
[
0
]
form
[
'2013-06-06 17:00:00-voice'
]
=
1
form
[
'2013-06-06 17:00:00-comment'
]
=
"jaw-dropping comment"
votepageagain
=
form
.
submit
()
self
.
assertContains
(
votepageagain
,
'jaw-dropping comment'
,
count
=
1
,
status_code
=
200
)
self
.
assertContains
(
votepageagain
,
'cell-header'
,
count
=
1
,
status_code
=
200
)
nuages/test_functional.py
View file @
ecd81ad0
...
...
@@ -39,36 +39,3 @@ class HomePage(WebTest):
assert
'Nuages - Easy poll sharing'
in
home
.
content
class
MeetingPoll
(
WebTest
):
def
setUp
(
self
):
self
.
poll
=
pollFactory
()
def
test_is_displayed
(
self
):
response
=
self
.
app
.
get
(
self
.
poll
.
link
)
self
.
assertEqual
(
response
.
status_code
,
200
)
self
.
assertTrue
(
'form'
in
response
.
context
)
self
.
assertEqual
(
response
.
context
[
'object'
].
id
,
self
.
poll
.
id
)
def
test_404
(
self
):
response
=
self
.
app
.
get
(
'/%s/'
%
createId
(
5
),
status
=
404
)
self
.
assertEqual
(
response
.
status_code
,
404
)
def
test_creation
(
self
):
new
=
self
.
app
.
get
(
reverse
(
'new'
))
form
=
new
.
forms
[
0
]
form
[
'title'
]
=
'fake title'
form
[
'description'
]
=
'fake description'
edition
=
form
.
submit
().
follow
()
self
.
assertContains
(
edition
,
'Manage choices'
,
count
=
1
,
status_code
=
200
)
form
=
edition
.
forms
[
0
]
form
[
'choice_set-0-choice_0'
]
=
'06/06/2013 17:00'
form
[
'choice_set-0-details'
]
=
'fake detail'
votepage
=
form
.
submit
().
follow
()
form
=
votepage
.
forms
[
0
]
form
[
'2013-06-06 17:00:00-voice'
]
=
1
form
[
'2013-06-06 17:00:00-comment'
]
=
"jaw-dropping comment"
votepageagain
=
form
.
submit
()
self
.
assertContains
(
votepageagain
,
'jaw-dropping comment'
,
count
=
1
,
status_code
=
200
)
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