fix warnings

This commit is contained in:
Gabriel Augendre 2024-11-30 09:57:07 +01:00 committed by crocmagnon-pr[bot]
parent cae57be617
commit c0c1276a09
6 changed files with 10 additions and 7 deletions

1
.gitignore vendored
View file

@ -40,3 +40,4 @@ dashboard_templates/backup_*.zip
character.json character.json
.direnv/ .direnv/
.venv/ .venv/
node_modules

View file

@ -28,7 +28,7 @@ class Command(BaseCommand):
icon_url = state_row.find_element( icon_url = state_row.find_element(
By.CSS_SELECTOR, By.CSS_SELECTOR,
".views-field-field-svg-icon img", ".views-field-field-svg-icon img",
).get_attribute("src") ).get_dom_attribute("src")
state, _ = HarmfulState.objects.update_or_create( state, _ = HarmfulState.objects.update_or_create(
name=name, name=name,
defaults={"description": description, "url": url, "icon_url": icon_url}, defaults={"description": description, "url": url, "icon_url": icon_url},

View file

@ -19,7 +19,7 @@ class Command(BaseCommand):
By.CSS_SELECTOR, By.CSS_SELECTOR,
".card-body .card-title a", ".card-body .card-title a",
) )
urls = [anchor.get_attribute("href") for anchor in anchors] urls = [anchor.get_dom_attribute("href") for anchor in anchors]
for url in urls: for url in urls:
try: try:
self.import_path(url) self.import_path(url)

View file

@ -12,7 +12,7 @@ class Command(BaseCommand):
self.setup_selenium() self.setup_selenium()
self.selenium.get(url) self.selenium.get(url)
anchors = self.selenium.find_elements(By.CSS_SELECTOR, ".card-img-top a") anchors = self.selenium.find_elements(By.CSS_SELECTOR, ".card-img-top a")
urls = [anchor.get_attribute("href") for anchor in anchors] urls = [anchor.get_dom_attribute("href") for anchor in anchors]
for url in urls: for url in urls:
try: try:
self.import_profile(url) self.import_profile(url)

View file

@ -11,7 +11,7 @@ class Command(BaseCommand):
self.setup_selenium() self.setup_selenium()
self.selenium.get(url) self.selenium.get(url)
anchors = self.selenium.find_elements(By.CSS_SELECTOR, "h2 a") anchors = self.selenium.find_elements(By.CSS_SELECTOR, "h2 a")
urls = [anchor.get_attribute("href") for anchor in anchors] urls = [anchor.get_dom_attribute("href") for anchor in anchors]
for url in urls: for url in urls:
try: try:
self.import_race(url) self.import_race(url)

View file

@ -79,10 +79,12 @@ def test_pet_happy_path(selenium: WebDriver, live_server: LiveServer):
# I have the same form as previously, pre-filled with the current values of my pet. # I have the same form as previously, pre-filled with the current values of my pet.
selenium.find_element(By.CSS_SELECTOR, f".pet[data-id='{pet.pk}'] .edit").click() selenium.find_element(By.CSS_SELECTOR, f".pet[data-id='{pet.pk}'] .edit").click()
pet_name = selenium.find_element(By.ID, "id_name") pet_name = selenium.find_element(By.ID, "id_name")
assert pet_name.get_attribute("value") == "My pet" assert pet_name.get_dom_attribute("value") == "My pet"
assert selenium.find_element(By.ID, "id_health_max").get_attribute("value") == "10"
assert ( assert (
selenium.find_element(By.ID, "id_health_remaining").get_attribute("value") selenium.find_element(By.ID, "id_health_max").get_dom_attribute("value") == "10"
)
assert (
selenium.find_element(By.ID, "id_health_remaining").get_dom_attribute("value")
== "9" == "9"
) )
pet_name.clear() pet_name.clear()