Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
CIRCLE
/
cloud
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
94
Merge Requests
10
Pipelines
Wiki
Snippets
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
e436c3b7
authored
Jun 25, 2013
by
Dudás Ádám
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
school: test for group_new view
parent
162a15f8
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
0 deletions
+17
-0
school/tests/test_views.py
+17
-0
No files found.
school/tests/test_views.py
View file @
e436c3b7
...
...
@@ -137,3 +137,20 @@ class ViewTestCase(TestCase):
resp
=
self
.
client
.
get
(
url
)
self
.
assertEqual
(
404
,
resp
.
status_code
)
def
test_group_new
(
self
):
self
.
login
()
url
=
reverse
(
'school.views.group_new'
)
member1
=
Person
.
objects
.
create
(
code
=
"A1B2C3"
)
members
=
[
member1
]
data
=
{
'name'
:
'myNewGrp'
,
'semester'
:
Semester
.
get_current
()
.
id
,
'members'
:
'
\n
'
.
join
([
m
.
code
for
m
in
members
]),
}
resp
=
self
.
client
.
post
(
url
,
data
)
group
=
Group
.
objects
.
get
(
name
=
data
[
'name'
])
self
.
assertEqual
(
Semester
.
get_current
(),
group
.
semester
)
for
member
in
members
:
self
.
assertIn
(
member
,
group
.
members
.
all
())
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