Пример #1
0
 def test_post_settings_response(self):
     response = self.client.post(
         reverse('settings'), {
             'first_name': 'first_name',
             'last_name': 'last_name',
             'job_title': 'job_title'
         })
     self.assertEqual(response.status_code, 200)
Пример #2
0
 def test_post_picture_response(self):
     response = self.client.get(reverse('picture'),
                                {'upload_picture': 'uploaded'})
     self.assertEqual(response.status_code, 200)
     self.assertTrue('uploaded_picture' in response.context)
     self.assertEqual(response.context['uploaded_picture'], True)
Пример #3
0
 def test_get_settings_response(self):
     response = self.client.get(reverse('settings'))
     self.assertEqual(response.status_code, 200)
Пример #4
0
 def test_profile_respones(self):
     response = self.client.get(
         reverse('profile', kwargs={'username': '******'}))
     self.assertEqual(response.status_code, 200)
     self.assertTrue('bar_data' in response.context)
Пример #5
0
 def test_network_response_no_logged(self):
     response = self.other_client.get(reverse('network'))
     self.assertRedirects(response, '/?next=/network/', status_code=302)
Пример #6
0
 def test_network_response(self):
     response = self.client.get(reverse('network'))
     self.assertEqual(response.status_code, 200)
Пример #7
0
 def test_get_home_response_no_logged(self):
     response = self.other_client.get(reverse('feeds'))
     self.assertRedirects(response, '/?next=/feeds/', status_code=302)
Пример #8
0
 def test_get_home_response(self):
     response = self.client.get(reverse('feeds'))
     self.assertEqual(response.status_code, 200)
     self.assertIn('<Page 1 of 1>', str(response.context['feeds']))