Fix all tests

This commit is contained in:
Kuroshini 2019-10-16 14:11:07 +03:00
parent dd0b595132
commit 4eaa600fc1
2 changed files with 9 additions and 1 deletions

View File

@ -25,7 +25,7 @@ def recalculate_price_levels_by_country(country_id):
establishment.recalculate_price_level(low_price=country.low_price,
high_price=country.high_price)
@periodic_task(run_every=crontab(minute=60))
@periodic_task(run_every=crontab(minute=59))
def rebuild_establishment_indices():
management.call_command(search_index.Command(), action='rebuild', models=[models.Establishment.__name__],
force=True)

View File

@ -9,6 +9,7 @@ from account.models import User
from news.models import News, NewsType
from establishment.models import Establishment, EstablishmentType, Employee
from location.models import Country
class BaseTestCase(APITestCase):
@ -39,7 +40,13 @@ class TranslateFieldTests(BaseTestCase):
self.news_type = NewsType.objects.create(name="Test news type")
self.news_type.save()
self.country_ru = Country.objects.get(
name={"en-GB": "Russian"}
)
self.news_item = News.objects.create(
id=8,
created_by=self.user,
modified_by=self.user,
title={
@ -52,6 +59,7 @@ class TranslateFieldTests(BaseTestCase):
news_type=self.news_type,
slug='test',
state=News.PUBLISHED,
country=self.country_ru,
)
self.news_item.save()