100% coverage en user api_views
This commit is contained in:
@@ -111,13 +111,14 @@ class TestAPIViews(TestCase):
|
||||
self.assertEqual(social_networks.youtube, new_social_data['youtube'])
|
||||
self.assertEqual(social_networks.twitch, new_social_data['twitch'])
|
||||
|
||||
def test_put_social_networks_empty(self):
|
||||
new_social_data = {}
|
||||
def test_put_social_networks_invalid(self):
|
||||
# max length para los fields es 255 => len('toolong'*37) == 259
|
||||
new_social_data = {'twitter': 'toolong'*37}
|
||||
|
||||
response = self.client.put('/api/users/user/2/social_networks', json.dumps(new_social_data),
|
||||
HTTP_AUTHORIZATION=self._user_header())
|
||||
|
||||
self.assertEqual(response.status_code, 200)
|
||||
self.assertEqual(response.status_code, 400)
|
||||
|
||||
def test_put_social_networks_not_modifying_self(self):
|
||||
new_social_data = {}
|
||||
|
||||
Reference in New Issue
Block a user