fix news test

This commit is contained in:
alex 2019-12-23 12:33:31 +03:00
parent 7525e6ceef
commit f6dac3cbcd

View File

@ -31,7 +31,6 @@ class BaseTestCase(APITestCase):
'refresh_token': tokens.get('refresh_token')})
self.test_news_type = NewsType.objects.create(name="Test news type")
self.lang, created = Language.objects.get_or_create(
title='Russia',
locale='ru-RU'
@ -57,13 +56,11 @@ class BaseTestCase(APITestCase):
)
user_role.save()
self.test_news = News.objects.create(
created_by=self.user, modified_by=self.user,
title={"ru-RU": "Test news"},
news_type=self.test_news_type,
description={"ru-RU": "Description test news"},
start=datetime.now() + timedelta(hours=-2),
end=datetime.now() + timedelta(hours=2),
state=News.PUBLISHED,
slugs={'en-GB': 'test-news-slug'},
@ -119,7 +116,6 @@ class NewsTestCase(BaseTestCase):
'id': self.test_news.id,
'description': {"ru-RU": "Description test news!"},
'slugs': self.test_news.slugs,
'start': self.test_news.start,
'news_type_id': self.test_news.news_type_id,
'country_id': self.country_ru.id,
"site_id": self.site_ru.id