mirror of
https://github.com/Hopiu/django-select2.git
synced 2026-04-14 18:30:59 +00:00
Select2Widget test: move general error check to the end of the function; test that the select2 results get displayed when the widget is clicked
This commit is contained in:
parent
12b00c1084
commit
537c8ec40b
1 changed files with 5 additions and 2 deletions
|
|
@ -25,8 +25,11 @@ class TestSelect2Widget(object):
|
|||
|
||||
def test_selecting(self, db, client, live_server, driver):
|
||||
driver.get(live_server + self.url)
|
||||
dropdown = driver.find_element_by_css_selector('.select2-results')
|
||||
assert dropdown.is_displayed() is False
|
||||
elem = driver.find_element_by_css_selector('.select2-choice')
|
||||
elem.click()
|
||||
assert dropdown.is_displayed() is True
|
||||
with pytest.raises(NoSuchElementException):
|
||||
error = driver.find_element_by_xpath('//body[@JSError]')
|
||||
pytest.fail(error.get_attribute('JSError'))
|
||||
elem = driver.find_element_by_id('s2id_id_number')
|
||||
elem.click()
|
||||
|
|
|
|||
Loading…
Reference in a new issue