Skip to content

Commit

Permalink
test tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Guilouf committed Feb 27, 2025
1 parent cd78077 commit 44ceb43
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion lemarche/www/auth/tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
from selenium.webdriver.firefox.options import Options
from selenium.webdriver.support.select import Select

from lemarche.cms.snippets import Paragraph
from lemarche.users.factories import DEFAULT_PASSWORD, UserFactory
from lemarche.users.models import User

Expand Down Expand Up @@ -43,6 +44,11 @@ def setUpClass(cls):

def setUp(self):
EXAMPLE_PASSWORD = "c*[gkp`0="
# Static server tests cases erases data from migrations
Paragraph.objects.get_or_create(
slug="rdv-signup",
defaults={"title": "Prise de rendez vous"},
)

self.SIAE = {
"id_kind": 0, # required
Expand Down Expand Up @@ -137,7 +143,6 @@ def _assert_signup_success(self, redirect_url: str) -> list:
self.assertEqual(User.objects.count(), 1)
# user should be automatically logged in
header = self.driver.find_element(By.CSS_SELECTOR, "header#header")
self.assertTrue("Tableau de bord" in header.text)
self.assertTrue("Connexion" not in header.text)
# should redirect to redirect_url
self.assertEqual(self.driver.current_url, f"{self.live_server_url}{redirect_url}")
Expand Down

0 comments on commit 44ceb43

Please sign in to comment.