Commit 65775abee7f6efd9480cf423f9412f50e74abd67
Exists in
master
and in
5 other branches
Merge branch 'dev' of https://github.com/amadeusproject/amadeuslms into dev
Showing
5 changed files
with
11 additions
and
30 deletions
Show diff stats
core/templates/guest.html
... | ... | @@ -81,6 +81,7 @@ |
81 | 81 | </li> |
82 | 82 | <li data-toggle="tooltip" data-placement="bottom" title data-original-title="{% trans 'messages' %}"> <a href="#"><i class="fa fa-comments" aria-hidden="true"></i></a> </li> |
83 | 83 | <li > <a class="link" href="{% url 'app:index' %}">{{ user }}</a></li> |
84 | + <li data-toggle="tooltip" data-placement="bottom" title data-original-title="log out"> <a href="{% url 'app:index' %}"><i class="fa fa-sign-out" aria-hidden="true"></i></a></li> | |
84 | 85 | </ul> |
85 | 86 | </div> |
86 | 87 | </div> | ... | ... |
forum/tests/test_model_answer.py
forum/tests/test_model_forum.py
forum/tests/test_model_post.py
forum/tests/test_view_forum.py
... | ... | @@ -42,13 +42,11 @@ class ForumViewTestCase (TestCase): |
42 | 42 | |
43 | 43 | self.category = CourseCategory.objects.create( |
44 | 44 | name = 'Category test', |
45 | - slug = 'category_test' | |
46 | 45 | ) |
47 | 46 | self.category.save() |
48 | 47 | |
49 | 48 | self.course = Course.objects.create( |
50 | 49 | name = 'Course Test', |
51 | - slug = 'course_test', | |
52 | 50 | max_students = 50, |
53 | 51 | init_register_date = '2016-08-26', |
54 | 52 | end_register_date = '2016-10-01', |
... | ... | @@ -60,7 +58,6 @@ class ForumViewTestCase (TestCase): |
60 | 58 | |
61 | 59 | self.subject = Subject.objects.create( |
62 | 60 | name = 'Subject Test', |
63 | - slug='subject-test', | |
64 | 61 | description = "description of the subject test", |
65 | 62 | visible = True, |
66 | 63 | course = self.course, |
... | ... | @@ -80,7 +77,6 @@ class ForumViewTestCase (TestCase): |
80 | 77 | self.forum = Forum.objects.create( |
81 | 78 | topic=self.topic, |
82 | 79 | name = 'forum test', |
83 | - slug='forum-test', | |
84 | 80 | description = 'description of the forum test', |
85 | 81 | create_date = '2016-10-02', |
86 | 82 | modification_date = '2016-10-03', |
... | ... | @@ -180,7 +176,7 @@ class ForumViewTestCase (TestCase): |
180 | 176 | self.assertEquals(list_forum, Forum.objects.all().count()) |
181 | 177 | |
182 | 178 | response = self.client_student.post(url, data) |
183 | - self.assertEquals (response.status_code, 400) | |
179 | + self.assertEquals (response.status_code, 403) | |
184 | 180 | self.assertEquals(list_forum, Forum.objects.all().count()) |
185 | 181 | |
186 | 182 | def test_CreateForum_form_ok (self): |
... | ... | @@ -214,20 +210,7 @@ class ForumViewTestCase (TestCase): |
214 | 210 | self.assertEquals(response.status_code, 200) |
215 | 211 | |
216 | 212 | response = self.client_professor.get(url) |
217 | - self.assertEquals(response.status_code, 200) | |
218 | - | |
219 | - #response = self.client_student.get(url) | |
220 | - #self.assertEquals(response.status_code, 400) | |
221 | - | |
222 | - | |
223 | - def test_UpdateForum_context(self): | |
224 | - url = reverse('course:forum:update', kwargs={'pk':self.forum.pk}) | |
225 | - | |
226 | - response = self.client.get(url) | |
227 | - self.assertTrue('form' in response.context) | |
228 | - | |
229 | - response = self.client_professor.get(url) | |
230 | - self.assertTrue('form' in response.context) | |
213 | + self.assertEquals(response.status_code, 302) | |
231 | 214 | |
232 | 215 | |
233 | 216 | def test_UpdateForum_form_error (self): |
... | ... | @@ -238,10 +221,10 @@ class ForumViewTestCase (TestCase): |
238 | 221 | self.assertEquals (response.status_code, 400) |
239 | 222 | |
240 | 223 | response = self.client_professor.post(url, data) |
241 | - self.assertEquals (response.status_code, 400) | |
224 | + self.assertEquals (response.status_code, 302) | |
242 | 225 | |
243 | 226 | response = self.client_student.post(url, data) |
244 | - self.assertEquals (response.status_code, 400) | |
227 | + self.assertEquals (response.status_code, 302) | |
245 | 228 | |
246 | 229 | def test_UpdateForum_form_ok (self): |
247 | 230 | url = reverse('course:forum:update', kwargs={'pk':self.forum.pk}) |
... | ... | @@ -260,16 +243,16 @@ class ForumViewTestCase (TestCase): |
260 | 243 | |
261 | 244 | data['name'] = 'Forum Updated as professor' |
262 | 245 | self.assertEquals(Forum.objects.all()[0].name, 'Forum Updated') |
263 | - response = self.client_professor.post(url, data) | |
246 | + response = self.client.post(url, data) | |
264 | 247 | self.assertEquals (response.status_code, 302) |
265 | 248 | self.assertEquals(Forum.objects.all()[0].name, 'Forum Updated as professor') |
266 | 249 | forum = Forum.objects.get(name='Forum Updated as professor') |
267 | 250 | |
268 | - #data['name'] = 'Forum Updated as student' | |
269 | - #self.assertEquals(Forum.objects.all()[0].name, 'Forum Updated as professor') | |
270 | - #response = self.client_student.post(url, data) | |
271 | - #self.assertEquals (response.status_code, 400) | |
272 | - #self.assertNotEquals(Forum.objects.all()[0].name, 'Forum Updated as student') | |
251 | + data['name'] = 'Forum Updated as student' | |
252 | + self.assertEquals(Forum.objects.all()[0].name, 'Forum Updated as professor') | |
253 | + response = self.client_student.post(url, data) | |
254 | + self.assertEquals (response.status_code, 302) | |
255 | + self.assertNotEquals(Forum.objects.all()[0].name, 'Forum Updated as student') | |
273 | 256 | forum = Forum.objects.get(name='Forum Updated as professor') |
274 | 257 | |
275 | 258 | ######################### CreatePostView ######################### | ... | ... |