Skip to content
This repository has been archived by the owner on Feb 23, 2020. It is now read-only.

Commit

Permalink
Fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
ArtemijRodionov committed Feb 23, 2019
1 parent 60aa1a5 commit 4088ea1
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 25 deletions.
13 changes: 0 additions & 13 deletions stroyprombeton/tests/helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -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."""

Expand Down
13 changes: 1 addition & 12 deletions stroyprombeton/tests/tests_views.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 = '<link rel="canonical" href="{path}">'
Expand Down Expand Up @@ -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):
Expand Down

0 comments on commit 4088ea1

Please sign in to comment.