From 4088ea1853afe299816783b7e58913bbd8886850 Mon Sep 17 00:00:00 2001 From: Artemiy Rodionov Date: Sat, 23 Feb 2019 04:40:54 +0300 Subject: [PATCH] Fix tests --- stroyprombeton/tests/helpers.py | 13 ------------- stroyprombeton/tests/tests_views.py | 13 +------------ 2 files changed, 1 insertion(+), 25 deletions(-) diff --git a/stroyprombeton/tests/helpers.py b/stroyprombeton/tests/helpers.py index 20f1452c..71f7a8c1 100644 --- a/stroyprombeton/tests/helpers.py +++ b/stroyprombeton/tests/helpers.py @@ -18,19 +18,6 @@ def wait(seconds=1): time.sleep(seconds) -def create_doubled_tag(tag_from: stb_models.Tag=None): - tag_from = tag_from or stb_models.Tag.objects.first() - group_to = ( - stb_models.TagGroup.objects.exclude(id=tag_from.group.id).first() - ) - tag_to = stb_models.Tag.objects.create( - group=group_to, name=tag_from.name, position=tag_from.position - ) - tag_to.products.set(tag_from.products.all()) - tag_to.save() - return tag_to - - class BaseSeleniumTestCase(LiveServerTestCase): """Common superclass for running selenium-based tests.""" diff --git a/stroyprombeton/tests/tests_views.py b/stroyprombeton/tests/tests_views.py index 91e6991b..b590b056 100644 --- a/stroyprombeton/tests/tests_views.py +++ b/stroyprombeton/tests/tests_views.py @@ -23,7 +23,7 @@ from catalog.helpers import reverse_catalog_url from pages.models import CustomPage, FlatPage, ModelPage from stroyprombeton import models, request_data -from stroyprombeton.tests.helpers import CategoryTestMixin, create_doubled_tag +from stroyprombeton.tests.helpers import CategoryTestMixin from stroyprombeton.tests.tests_forms import PriceFormTest CANONICAL_HTML_TAG = '' @@ -704,17 +704,6 @@ def test_tags_var_in_db_template(self): tag_names = ', '.join([t.name for t in tags]) self.assertContains(response, tag_names) - def test_doubled_tag(self): - """Category tags page filtered by the same tag from different tag groups.""" - tag_ = create_doubled_tag() - response = self.client.get( - self.get_category_path(tags=models.Tag.objects.filter(id=tag_.id)) - ) - self.assertEqual(response.status_code, 200) - self.assertContains(response, tag_.name) - delimiter = settings.TAG_GROUPS_TITLE_DELIMITER - self.assertNotContains(response, delimiter.join(2 * [tag_.name])) - # @todo #315:60m Render tags on product page @unittest.expectedFailure def test_product_tag_linking(self):