Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
mentors.debian.net
debexpo
Commits
30820466
Verified
Commit
30820466
authored
Jan 06, 2022
by
Baptiste Beauplat
Browse files
Add a test to cover invalid comment form
parent
00b2a989
Changes
1
Show whitespace changes
Inline
Side-by-side
tests/functional/packages/test_package.py
View file @
30820466
...
@@ -238,6 +238,22 @@ class TestPackageController(TestController):
...
@@ -238,6 +238,22 @@ class TestPackageController(TestController):
def
test_comment_bad_method
(
self
):
def
test_comment_bad_method
(
self
):
self
.
_test_bad_method
(
'comment_package'
)
self
.
_test_bad_method
(
'comment_package'
)
def
test_comment_bad_form
(
self
):
self
.
client
.
post
(
reverse
(
'login'
),
self
.
_AUTHDATA
)
upload
=
PackageUpload
.
objects
.
filter
(
package__name
=
'testpackage'
)
\
.
earliest
(
'uploaded'
)
response
=
self
.
client
.
post
(
reverse
(
'comment_package'
,
args
=
[
'testpackage'
]),
{
'upload_id'
:
upload
.
id
,
'text'
:
'This is a test comment'
,
'outcome'
:
42
,
'commit'
:
'submit_comment'
})
self
.
assertEquals
(
response
.
status_code
,
200
)
self
.
assertIn
(
'errorlist'
,
str
(
response
.
content
))
def
test_comment
(
self
):
def
test_comment
(
self
):
self
.
client
.
post
(
reverse
(
'login'
),
self
.
_AUTHDATA
)
self
.
client
.
post
(
reverse
(
'login'
),
self
.
_AUTHDATA
)
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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