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

#320 Tag tests #337

Merged
merged 10 commits into from
Nov 17, 2018
Merged

#320 Tag tests #337

merged 10 commits into from
Nov 17, 2018

Conversation

duker33
Copy link
Contributor

@duker33 duker33 commented Nov 15, 2018

Closes #320

@duker33 duker33 self-assigned this Nov 15, 2018
@@ -214,9 +214,13 @@ def create_products(count, categories, tags_):
for tag in tags_:
product.tags.add(tag)

# group together tags from different tag_groups
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The comment below will be enough. Decide

create_products(count=25, categories=parents[4:], tags_=zipped_tags[0])
create_products(count=25, categories=parents[5:], tags_=zipped_tags[0])
# some products should not contain any tag
create_products(count=25, categories=parents[4:4], tags_=[])
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
create_products(count=25, categories=parents[4:4], tags_=[])
create_products(count=25, categories=parents[4:5], tags_=[])

[4:4] produces an empty list


from pages.models import Page

from stroyprombeton.models import Category, Product
# @todo #320:15m - Do the whole `models` import in tests_selenium
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Import the stroyprombeton.models package as stb_models for the whole project.

Copy link
Contributor Author

@duker33 duker33 Nov 15, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@artemiy312 , it's too long. I suggest this:
Import 'models' to it's own var

sorting: int=None,
query_string: dict=None,
) -> str:
from urllib.parse import urlencode
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Move an import to the top

@@ -195,6 +207,25 @@ def test_inactive_product_not_in_category(self):
response = self.client.get(reverse('category', args=(test_product.category_id,)))
self.assertNotIn(test_product, response.context['products'])

# @todo #320:60m Take from SE CatalogTags tests
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What should we take?

@duker33 duker33 merged commit dec56f7 into master Nov 17, 2018
@duker33 duker33 deleted the 320_tag_tests branch November 17, 2018 06:51
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants