You are trying to self.client.get
an unexistent URL: made_up_url
. As dan-klasson told you, you need to get /made_up_url
.
I suggest that, instead of hardcoding the URL in the self.client.get
arguments, first name the related URL in your urls.py
file. So you can resolve it via the reverse
function.
Then, once you have a name
for it, you can do this in your unit tests:
from django.core.urlresolvers import reverse
url = reverse('made_up_url')
resp = self.client.get(url)
self.assertEqual(resp.status_code, 404)