diff --git a/src/lists/tests.py b/src/lists/tests.py index 4102f7f..10a554c 100644 --- a/src/lists/tests.py +++ b/src/lists/tests.py @@ -28,7 +28,7 @@ class HomePageTest(TestCase): response = self.client.post('/', data={'item_text': 'A new list item'}) self.assertEqual(response.status_code, 302) - self.assertEqual(response['location'], '/') + self.assertEqual(response['location'], '/lists/the-only-list-in-the-world') def test_only_saves_items_when_necessary(self): self.client.get('/') diff --git a/src/lists/views.py b/src/lists/views.py index c21ec5f..b5318bb 100644 --- a/src/lists/views.py +++ b/src/lists/views.py @@ -8,7 +8,7 @@ from lists.models import Item def home_page(request): if request.method == 'POST': Item.objects.create(text=request.POST['item_text']) - return redirect('/') + return redirect('/lists/the-only-list-in-the-world') items = Item.objects.all() # get objects from database (model) return render(request=request,