Skip to content

Commit

Permalink
Smells like subtests
Browse files Browse the repository at this point in the history
  • Loading branch information
twm committed Jan 11, 2025
1 parent b12ede1 commit 2ab7fc5
Showing 1 changed file with 10 additions and 12 deletions.
22 changes: 10 additions & 12 deletions yarrharr/tests/test_views.py
Original file line number Diff line number Diff line change
Expand Up @@ -121,19 +121,17 @@ def test_login_redirect(self):
"/article/1234/",
]

redirects = []
for next_ in nexts:
response = c.post(
"/login/",
{
"next": next_,
"username": "james",
"password": "hunter2",
},
)
redirects.append(response["Location"])

self.assertEqual(nexts, redirects)
with self.subTest("login", next=next_):
response = c.post(
"/login/",
{
"next": next_,
"username": "james",
"password": "hunter2",
},
)
self.assertEqual(next_, response["Location"])


class LabelListTests(TestCase):
Expand Down

0 comments on commit 2ab7fc5

Please sign in to comment.