Implement some suggestions from the Doctor

This commit is contained in:
2023-05-20 17:02:33 +01:00
parent 0b22669a29
commit 90ae87b1b2
12 changed files with 39 additions and 33 deletions

View File

@@ -114,7 +114,7 @@ class CreateEvent(FormPage):
}
def select_event_type(self, type_name):
self.find_element(By.XPATH, '//button[.="{}"]'.format(type_name)).click()
self.find_element(By.XPATH, f'//button[.="{type_name}"]').click()
def item_row(self, ID):
return rigs_regions.ItemRow(self, self.find_element(By.ID, "item-" + ID))

View File

@@ -259,7 +259,7 @@ class TestPrintPaperwork(TestCase):
def test_login_redirect(client, django_user_model):
request_url = reverse('event_embed', kwargs={'pk': 1})
expected_url = "{0}?next={1}".format(reverse('login_embed'), request_url)
expected_url = f"{reverse('login_embed')}?next={request_url}"
# Request the page and check it redirects
response = client.get(request_url, follow=True)
@@ -372,7 +372,8 @@ def test_ra_redirect(admin_client, admin_user, ra):
class TestMarkdownTemplateTags(TestCase):
markdown = open(os.path.join(settings.BASE_DIR, "RIGS/tests/sample.md")).read()
with open(os.path.join(settings.BASE_DIR, "RIGS/tests/sample.md")) as f:
markdown = f.read()
def test_html_safe(self):
html = markdown_filter(self.markdown)