main back test

This commit is contained in:
alex 2019-11-28 15:29:42 +03:00
parent 5a3093be51
commit c81dbf2d8e

View File

@ -9,7 +9,7 @@ from location.models import Country
from main.models import Award, AwardType
class AwardTestCase(APITestCase):
class BaseTestCase(APITestCase):
def setUp(self):
self.user = User.objects.create_user(
@ -25,6 +25,12 @@ class AwardTestCase(APITestCase):
{'access_token': tokens.get('access_token'),
'refresh_token': tokens.get('refresh_token')})
class AwardTestCase(BaseTestCase):
def setUp(self):
super().setUp()
self.country_ru = Country.objects.create(
name={'en-GB': 'Russian'},
code='RU',
@ -71,3 +77,13 @@ class AwardTestCase(APITestCase):
response = self.client.delete(f'/api/back/main/awards/{self.award.id}/')
self.assertEqual(response.status_code, status.HTTP_204_NO_CONTENT)
class ContentTypeTestCase(BaseTestCase):
def setUp(self):
super().setUp()
def test_content_type_list(self):
response = self.client.get('/api/back/main/content_type/', format='json')
self.assertEqual(response.status_code, status.HTTP_200_OK)