Skip to content

Commit 7e06c81

Browse files
committed
fix(test): account for blank db case
1 parent 97e624b commit 7e06c81

1 file changed

Lines changed: 14 additions & 13 deletions

File tree

rse/tests/test_templates.py

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -211,19 +211,20 @@ def test_users(self):
211211
self.assertEqual(self.selenium.title, expected)
212212
self.check_for_log_errors()
213213

214-
# Test filter inactive users
215-
el_with_inactive_username = self.selenium.find_elements(By.XPATH, f"//*[contains(text(), '{INACTIVE_USER_USERNAME}')]")
216-
self.assertEqual(len(el_with_inactive_username), 0)
217-
218-
# test filter options
219-
dropdown = Select(self.selenium.find_element(By.ID, 'id_active_filter'))
220-
dropdown.select_by_visible_text('No')
221-
222-
el_with_inactive_username = self.selenium.find_elements(By.XPATH, f"//*[contains(text(), '{INACTIVE_USER_USERNAME}')]")
223-
self.assertEqual(len(el_with_inactive_username), 1)
224-
225-
el_with_django_username = self.selenium.find_elements(By.XPATH, "//*[contains(text(), 'django')]")
226-
self.assertEqual(len(el_with_django_username), 0)
214+
if self.blank_db != True:
215+
# Test filter inactive users
216+
el_with_inactive_username = self.selenium.find_elements(By.XPATH, f"//*[contains(text(), '{INACTIVE_USER_USERNAME}')]")
217+
self.assertEqual(len(el_with_inactive_username), 0)
218+
219+
# test filter options
220+
dropdown = Select(self.selenium.find_element(By.ID, 'id_active_filter'))
221+
dropdown.select_by_visible_text('No')
222+
223+
el_with_inactive_username = self.selenium.find_elements(By.XPATH, f"//*[contains(text(), '{INACTIVE_USER_USERNAME}')]")
224+
self.assertEqual(len(el_with_inactive_username), 1)
225+
226+
el_with_django_username = self.selenium.find_elements(By.XPATH, "//*[contains(text(), 'django')]")
227+
self.assertEqual(len(el_with_django_username), 0)
227228

228229
# test rse view (login should be required)
229230
self.get_url_as_rse(url)

0 commit comments

Comments
 (0)