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 +6,7 @@ from django.core.urlresolvers import reverse | ||
6 | from rolepermissions.shortcuts import assign_role | 6 | from rolepermissions.shortcuts import assign_role |
7 | 7 | ||
8 | from courses.models import Course, Category | 8 | from courses.models import Course, Category |
9 | +from courses.forms import CourseForm | ||
9 | from users.models import User | 10 | from users.models import User |
10 | 11 | ||
11 | class CourseViewTestCase(TestCase): | 12 | class CourseViewTestCase(TestCase): |
@@ -98,14 +99,16 @@ class CourseViewTestCase(TestCase): | @@ -98,14 +99,16 @@ class CourseViewTestCase(TestCase): | ||
98 | 99 | ||
99 | 100 | ||
100 | def test_update(self): | 101 | def test_update(self): |
102 | + | ||
101 | self.client.login(username = 'test', password = 'testing') | 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 | def test_update_not_logged(self): | 113 | def test_update_not_logged(self): |
111 | url = reverse('course:update', kwargs = {'slug': self.course.slug}) | 114 | url = reverse('course:update', kwargs = {'slug': self.course.slug}) |
logs/log_file_05-09-2016.txt
@@ -42,3 +42,4 @@ | @@ -42,3 +42,4 @@ | ||
42 | 05/09/2016 04:39:39 - test - Entrou no sistema | 42 | 05/09/2016 04:39:39 - test - Entrou no sistema |
43 | 05/09/2016 04:39:39 - test - Acessou home | 43 | 05/09/2016 04:39:39 - test - Acessou home |
44 | 05/09/2016 04:40:28 - matheuslins - Acessou home | 44 | 05/09/2016 04:40:28 - matheuslins - Acessou home |
45 | +05/09/2016 15:14:48 - matheuslins - Acessou home |
@@ -0,0 +1,10 @@ | @@ -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 |