reenabled admin area; outfitted apps.lyric.models w. AbstractBaseUser instead of custom user class; many other fns & several models updated to accomodate, such as set_unusable_password() method to base user model; reset staging db to prepare for refreshed lyric migrations to accomodate for retrofitted pw field
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
This commit is contained in:
28
src/functional_tests/test_admin.py
Normal file
28
src/functional_tests/test_admin.py
Normal file
@@ -0,0 +1,28 @@
|
||||
from selenium.webdriver.common.by import By
|
||||
|
||||
from .base import FunctionalTest
|
||||
from apps.lyric.models import User
|
||||
|
||||
|
||||
class AdminLoginTest(FunctionalTest):
|
||||
def setUp(self):
|
||||
super().setUp()
|
||||
self.superuser = User.objects.create_superuser(
|
||||
email="admin@example.com",
|
||||
password="correct-password",
|
||||
)
|
||||
|
||||
def test_can_access_admin(self):
|
||||
self.browser.get(self.live_server_url + "/admin/")
|
||||
|
||||
self.wait_for(lambda: self.browser.find_element(By.ID, "id_username"))
|
||||
self.browser.find_element(By.ID, "id_username").send_keys("admin@example.com")
|
||||
self.browser.find_element(By.ID, "id_password").send_keys("correct-password")
|
||||
self.browser.find_element(By.CSS_SELECTOR, "input[type=submit]").click()
|
||||
|
||||
body = self.wait_for(
|
||||
lambda: self.browser.find_element(By.TAG_NAME, "body")
|
||||
)
|
||||
self.assertIn("Site administration", body.text)
|
||||
self.assertIn("Users", body.text)
|
||||
self.assertIn("Tokens", body.text)
|
||||
Reference in New Issue
Block a user