Commit 954fa8ee3ad21215ff3250e56d28ca63bc106cfc
1 parent
6adb9412
Exists in
master
and in
5 other branches
creating test update course #42
Showing
3 changed files
with
19 additions
and
5 deletions
Show diff stats
courses/tests/test_views.py
... | ... | @@ -6,6 +6,7 @@ from django.core.urlresolvers import reverse |
6 | 6 | from rolepermissions.shortcuts import assign_role |
7 | 7 | |
8 | 8 | from courses.models import Course, Category |
9 | +from courses.forms import CourseForm | |
9 | 10 | from users.models import User |
10 | 11 | |
11 | 12 | class CourseViewTestCase(TestCase): |
... | ... | @@ -98,14 +99,16 @@ class CourseViewTestCase(TestCase): |
98 | 99 | |
99 | 100 | |
100 | 101 | def test_update(self): |
102 | + | |
101 | 103 | self.client.login(username = 'test', password = 'testing') |
102 | 104 | |
103 | - url = reverse('course:update', kwargs = {'slug': self.course.slug}) | |
105 | + url = reverse('course:update', kwargs = {'slug': self.course.slug}) | |
106 | + data = Course.objects.get(name="Curso Teste") | |
107 | + data.name = "Curse Test" | |
104 | 108 | |
105 | - response = self.client.get(url) | |
106 | - | |
107 | - self.assertEquals(response.status_code, 200) | |
108 | - self.assertTemplateUsed(response, 'course/update.html') | |
109 | + response = self.client.put(url, data, format='json') | |
110 | + self.assertEqual(response.status_code, 200) | |
111 | + # self.assertEqual(response.data, data.name) | |
109 | 112 | |
110 | 113 | def test_update_not_logged(self): |
111 | 114 | url = reverse('course:update', kwargs = {'slug': self.course.slug}) | ... | ... |
logs/log_file_05-09-2016.txt
... | ... | @@ -0,0 +1,10 @@ |
1 | +07/09/2016 17:10:46 - matheuslins - Entrou no sistema | |
2 | +07/09/2016 17:10:46 - matheuslins - Acessou home | |
3 | +07/09/2016 17:10:58 - matheuslins - Acessou home | |
4 | +07/09/2016 17:12:12 - matheuslins - Acessou home | |
5 | +07/09/2016 17:12:15 - matheuslins - Acessou home | |
6 | +07/09/2016 17:12:24 - matheuslins - Acessou home | |
7 | +07/09/2016 17:17:16 - matheuslins - Entrou no sistema | |
8 | +07/09/2016 17:17:16 - matheuslins - Acessou home | |
9 | +07/09/2016 17:24:09 - test - Entrou no sistema | |
10 | +07/09/2016 17:24:09 - test - Acessou home | ... | ... |