-
Notifications
You must be signed in to change notification settings - Fork 83
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
redirect to template for new assignment
- Loading branch information
Eurie Oh
committed
Sep 7, 2016
1 parent
13868bb
commit 2b5ed79
Showing
3 changed files
with
55 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
import datetime | ||
import json | ||
from server.models import db, Assignment, Backup, Course, User, Version | ||
from server.utils import encode_id | ||
from server.forms import VersionForm | ||
|
||
from tests import OkTestCase | ||
|
||
class TestAssignment(OkTestCase): | ||
|
||
def setUp(self): | ||
super().setUp() | ||
self.setup_course() | ||
|
||
def test_new_assignment(self): | ||
|
||
self.login(self.admin.email) | ||
|
||
data = { | ||
"display_name": "test", | ||
"name": "{}/test".format(self.course.offering), | ||
"due_date": "2016-09-14 23:59:59", | ||
"lock_date": "2016-09-15 23:59:59", | ||
"max_group_size": 1, | ||
"visible": True | ||
} | ||
|
||
response = self.client.post("admin/course/1/assignments/new", | ||
data=data, follow_redirects=True) | ||
|
||
self.assert200(response) | ||
self.assert_template_used('staff/course/assignment/assignment.template.html') | ||
|
||
|
||
def test_new_assignment_not_visible(self): | ||
|
||
self.login(self.admin.email) | ||
|
||
data = { | ||
"display_name": "test", | ||
"name": "{}/test".format(self.course.offering), | ||
"due_date": "2016-09-14 23:59:59", | ||
"lock_date": "2016-09-15 23:59:59", | ||
"max_group_size": 1 | ||
} | ||
|
||
response = self.client.post("admin/course/1/assignments/new", | ||
data=data, follow_redirects=True) | ||
|
||
self.assert200(response) | ||
self.assertTemplateUsed('staff/course/assignment/assignments.html') | ||
|