python - AssertionError: 200 != 403 -


For this, Django app and a test I'm getting the error:

  traceback ( Most recent call final): file "../support/tests.py", in line 17, foo self.assertEqual (response.status_code, HttpResponseForbidden .status_code) AssertionError: 200! = 403  

Code for testing, which causes trouble:

  feedback = self.client.get ('/ support / download / bar / ') Self.assertEqual (response.status_code, HttpResponseForbidden.status_code)  

I do not understand that routine is the problem to diagnose it, where There was no help in browsing the web for a similar problem to start looking at.

It looks like the URL / support / download / bar / ?

P>

What are your tests doing in test.py:

  Self.assertEqual (response.status_code, HttpResponseForbidden .status_code)  

You can go to URL / support / download / bar / one HttpResponseForbidden Checking the response (code 403).

Apparently, you have successfully displayed the page (code 200), which tells your error:

  AssertionError: 200! = 403  

You were expecting an error, but you had success in displaying the webpage.


Comments

Popular posts from this blog

Member with no value in F# -

java - Joda Time Interval Not returning what I expect -

c# - Showing a SelectedItem's Property -