Skip to content

Commit

Permalink
#728 Adapt page display usage to the new interface
Browse files Browse the repository at this point in the history
  • Loading branch information
duker33 committed Feb 17, 2019
1 parent 117de26 commit b9b453f
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 12 deletions.
15 changes: 6 additions & 9 deletions shopelectro/context.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

from catalog import newcontext
from images.models import Image
from pages import display, models as pages_models, newcontext as pages_newcontext
from pages import models as pages_models, newcontext as pages_newcontext
from shopelectro import models, request_data


Expand Down Expand Up @@ -33,14 +33,11 @@ def context(self):
# use dirty patch here, because it's the most simple method
# to make shared templates work.
# For example `templates/layout/metadata.html`.
self._page.display = display.Page(
page=self._page,
context={
'page': self._page,
'tag_titles': tags_qs.as_title(),
'tags': tags_qs,
}
)
self._page.display = {
'page': self._page,
'tag_titles': tags_qs.as_title(),
'tags': tags_qs,
}
return {
'page': self._page,
}
Expand Down
9 changes: 6 additions & 3 deletions shopelectro/tests/tests_selenium.py
Original file line number Diff line number Diff line change
Expand Up @@ -1085,9 +1085,6 @@ def clear_input(self):
def search(self):
self.browser.find_element_by_class_name('search-form').submit()
self.wait.until(EC.url_contains('/search/'))
self.wait.until(EC.visibility_of_element_located(
(By.CLASS_NAME, 'search-result-link')
))

def test_autocomplete_can_expand_and_collapse(self):
self.fill_input()
Expand Down Expand Up @@ -1140,6 +1137,9 @@ def test_search_have_results(self):
"""Search results page should contain links on relevant pages."""
self.fill_input()
self.search()
self.wait.until(EC.visibility_of_element_located(
(By.CLASS_NAME, 'search-result-link')
))

self.assertTrue(self.browser.find_element_by_link_text(
'Category #0 of #Category #0 of #Category #0'
Expand All @@ -1150,6 +1150,9 @@ def test_search_results_empty(self):
"""Search results for wrong term should contain empty result set."""
self.input.send_keys('Not existing search query')
self.search()
self.wait.until(EC.visibility_of_element_located(
(By.TAG_NAME, 'h1')
))

h1 = self.browser.find_element_by_tag_name('h1')

Expand Down

0 comments on commit b9b453f

Please sign in to comment.