Skip to content

Commit

Permalink
Fix typo in unit test.
Browse files Browse the repository at this point in the history
  • Loading branch information
ropable committed Nov 16, 2023
1 parent 39783eb commit b5ed613
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions prs2/referral/test_views.py
Original file line number Diff line number Diff line change
Expand Up @@ -335,7 +335,7 @@ def test_cancel(self):
def test_post(self):
"""Test that updating a referral actually changes it
"""
self.client.post(
response = self.client.post(
self.url,
{
'referring_org': self.ref.referring_org.pk,
Expand All @@ -347,6 +347,9 @@ def test_post(self):
},
follow=True
)
next_url = self.ref.get_absolute_url()
self.assertRedirects(
response, next_url, status_code=302, target_status_code=200)
self.assertTrue(Referral.objects.filter(reference='New reference value').exists())


Expand Down Expand Up @@ -656,7 +659,7 @@ def test_post(self):
for model in self.models:
for obj in model.objects.all():
# Child objects of referrals should redirect to the referral's URL.
if hasattr(obj, 'referra'):
if hasattr(obj, 'referral'):
next_url = obj.referral.get_absolute_url()
else:
next_url = reverse('site_home')
Expand All @@ -665,10 +668,8 @@ def test_post(self):
kwargs={
'model': obj._meta.object_name.lower(),
'pk': obj.pk})
response = self.client.post(
self.client.post(
url, {'delete': 'Delete', 'next': next_url}, follow=True)
self.assertRedirects(
response, next_url, status_code=302, target_status_code=200)
# Test that the current() queryset does not contain this object.
self.assertNotIn(obj.pk, [i.pk for i in model.objects.current()])

Expand Down

0 comments on commit b5ed613

Please sign in to comment.