diff --git a/cookbook/locale/ru/LC_MESSAGES/django.po b/cookbook/locale/ru/LC_MESSAGES/django.po index a8111337..52a4708a 100644 --- a/cookbook/locale/ru/LC_MESSAGES/django.po +++ b/cookbook/locale/ru/LC_MESSAGES/django.po @@ -8,8 +8,8 @@ msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2021-09-13 22:40+0200\n" -"PO-Revision-Date: 2023-04-12 11:55+0000\n" -"Last-Translator: noxonad \n" +"PO-Revision-Date: 2023-05-01 07:55+0000\n" +"Last-Translator: axeron2036 \n" "Language-Team: Russian \n" "Language: ru\n" @@ -286,7 +286,7 @@ msgstr "" #: .\cookbook\forms.py:497 msgid "Search Method" -msgstr "" +msgstr "Способ поиска" #: .\cookbook\forms.py:498 msgid "Fuzzy Lookups" diff --git a/cookbook/tests/api/test_api_food.py b/cookbook/tests/api/test_api_food.py index 504bee0a..e180576f 100644 --- a/cookbook/tests/api/test_api_food.py +++ b/cookbook/tests/api/test_api_food.py @@ -99,8 +99,12 @@ def test_list_space(obj_1, obj_2, u1_s1, u1_s2, space_2): assert json.loads(u1_s1.get(reverse(LIST_URL)).content)['count'] == 2 assert json.loads(u1_s2.get(reverse(LIST_URL)).content)['count'] == 0 - obj_1.space = space_2 - obj_1.save() + with scopes_disabled(): + # for some reason the 'path' attribute changes between the factory and the test + obj_1 = Food.objects.get(id=obj_1.id) + obj_2 = Food.objects.get(id=obj_2.id) + obj_1.space = space_2 + obj_1.save() assert json.loads(u1_s1.get(reverse(LIST_URL)).content)['count'] == 1 assert json.loads(u1_s2.get(reverse(LIST_URL)).content)['count'] == 1 @@ -494,10 +498,10 @@ def test_root_filter(obj_tree_1, obj_2, obj_3, u1_s1): def test_tree_filter(obj_tree_1, obj_2, obj_3, u1_s1): with scope(space=obj_tree_1.space): # for some reason the 'path' attribute changes between the factory and the test when using both obj_tree and obj + obj_tree_1 = Food.objects.get(id=obj_tree_1.id) parent = obj_tree_1.get_parent() obj_2.move(parent, node_location) obj_2 = Food.objects.get(id=obj_2.id) - obj_tree_1 = Food.objects.get(id=obj_tree_1.id) parent = Food.objects.get(id=parent.id) # should return full tree starting at parent (obj_tree_1, obj_2), ignoring query filters diff --git a/cookbook/tests/factories/__init__.py b/cookbook/tests/factories/__init__.py index b8844119..2f740cf9 100644 --- a/cookbook/tests/factories/__init__.py +++ b/cookbook/tests/factories/__init__.py @@ -116,7 +116,7 @@ class FoodFactory(factory.django.DjangoModelFactory): 'cookbook.tests.factories.RecipeFactory', space=factory.SelfAttribute('..space')), no_declaration=None ) - path = None + path = factory.LazyAttribute(lambda x: faker.numerify(text='%###')) space = factory.SubFactory(SpaceFactory) @factory.post_generation