Commit b9db95e5dc9d29a60d35d11b632f63f8ca10a1c2

Authored by ailsoncgt
1 parent 4d782f00

Test case for update user #7

Showing 1 changed file with 7 additions and 6 deletions   Show diff stats
core/tests.py
... ... @@ -165,21 +165,21 @@ class UpdateUserTestCase(TestCase):
165 165 data = {'username': 'test', 'password': 'testing1'}
166 166 response = self.client.post(reverse('core:home'), data)
167 167 self.assertRedirects(response, reverse('app:index'))
168   -
169 168  
170 169 data={
171   - 'username': 'testeamadeus',
172   - 'email': 'teste@amadeus.com',
  170 + 'username': 'test',
  171 + 'birth_date': '12/12/2000',
  172 + 'email': 'testing@amadeus.com',
  173 + 'cpf': '705.089.884-89',
173 174 'name': 'Teste Amadeus',
174 175 'city': 'Praia',
175 176 'state': 'PE',
176 177 'gender': 'F',
177 178 }
178   - # self.assertRedirects(response1, reverse('app:index'))
179 179 response = self.client.get(self.url)
180 180 self.assertEqual(response.status_code, 200)
181 181 response = self.client.post(self.url, data)
182   - self.assertEqual(response.status_code, 302)
  182 + self.assertRedirects(response, reverse('users:profile'))
183 183  
184 184 def test_update_error(self):
185 185  
... ... @@ -195,12 +195,13 @@ class UpdateUserTestCase(TestCase):
195 195 'username': '',
196 196 'email': 'teste@amadeus.com',
197 197 'name': 'Teste Amadeus',
  198 + 'birth_date': '12/12/2000',
198 199 'city': 'Praia',
199 200 'state': 'PE',
200 201 'gender': 'F',
201 202 }
202 203 response = self.client.post(self.url, data)
203   - self.assertFormError(response, 'form', 'username', 'This field is required.')
  204 + self.assertFormError(response, 'form', 'username', _('This field is required.'))
204 205  
205 206  
206 207 class DeleteUserTestCase(TestCase):
... ...