forked from aurelien.plancke/ScodocTestClient
blackify 02
This commit is contained in:
parent
0d177f7b0b
commit
0d860f2406
@ -34,6 +34,7 @@ URL_ADMIN = "/".join((URL_ROOT, "ScoDoc", "admin"))
|
||||
ACRONYME_FORMATION = "formationtest"
|
||||
URL = URL_SCODOC8
|
||||
|
||||
|
||||
class PythonOrgSearch(unittest.TestCase):
|
||||
# Permet de se connecter et se remettre sur la page d'accueil avant chaque test
|
||||
def setUp(self):
|
||||
@ -42,7 +43,7 @@ class PythonOrgSearch(unittest.TestCase):
|
||||
else:
|
||||
self.driver = webdriver.Chrome()
|
||||
self.wait = WebDriverWait(self.driver, 10)
|
||||
auth_page = URL_AUTH + ("?next=" + URL_HOME).replace("/", "%2F")
|
||||
auth_page = URL_AUTH
|
||||
self.driver.get(auth_page)
|
||||
self.driver.find_element_by_id("user_name").send_keys(SCODOC_ADMIN_ID)
|
||||
self.driver.find_element_by_id("password").send_keys(SCODOC_ADMIN_PASS)
|
||||
@ -76,7 +77,7 @@ class PythonOrgSearch(unittest.TestCase):
|
||||
driver = self.driver
|
||||
wait = self.wait
|
||||
driver.get(URL)
|
||||
id_edit_formation = "edit-formation-" + ACRONYME_FORMATION.replace(" ","-")
|
||||
id_edit_formation = "edit-formation-" + ACRONYME_FORMATION.replace(" ", "-")
|
||||
driver.find_element_by_id(id_edit_formation).click()
|
||||
wait.until(EC.url_changes(URL))
|
||||
driver.find_element_by_id("tf_acronyme").send_keys(ACRONYME_FORMATION)
|
||||
@ -86,7 +87,9 @@ class PythonOrgSearch(unittest.TestCase):
|
||||
text_element_acronyme = []
|
||||
for formation in formations:
|
||||
text_element_acronyme.append(formation.text)
|
||||
self.assertTrue(ACRONYME_FORMATION + ACRONYME_FORMATION in text_element_acronyme)
|
||||
self.assertTrue(
|
||||
ACRONYME_FORMATION + ACRONYME_FORMATION in text_element_acronyme
|
||||
)
|
||||
# Remise du nom à celui de départ
|
||||
driver.get(URL)
|
||||
id_edit_formation = "edit-formation-" + ACRONYME_FORMATION + ACRONYME_FORMATION
|
||||
@ -174,7 +177,9 @@ class PythonOrgSearch(unittest.TestCase):
|
||||
wait.until(EC.url_changes(URL))
|
||||
driver.find_element_by_name("date_debut").send_keys("01/01/2021")
|
||||
driver.find_element_by_name("date_fin").send_keys("30/06/2021")
|
||||
driver.find_element_by_name("responsable_id").send_keys("BACH Jean-Sebastien (Bach)")
|
||||
driver.find_element_by_name("responsable_id").send_keys(
|
||||
"BACH Jean-Sebastien (Bach)"
|
||||
)
|
||||
Select(driver.find_element_by_id("tf_semestre_id")).select_by_value("4")
|
||||
driver.find_element_by_id("tf_submit").click()
|
||||
wait.until(EC.url_changes(URL))
|
||||
|
Loading…
Reference in New Issue
Block a user