Skip to content

Instantly share code, notes, and snippets.

@Enome
Created April 14, 2011 10:17
Show Gist options
  • Save Enome/919225 to your computer and use it in GitHub Desktop.
Save Enome/919225 to your computer and use it in GitHub Desktop.
Virtual Browser vs RequestFactory
def test_should_return_200(self):
response = self.client.get(reverse('auth-registration'))
self.assertEqual(response.status_code, 200)
def test_shold_return_200_again(self):
request_factory = RequestFactory()
request = request_factory.get((reverse('auth-registration')))
registration_view = RegistrationView.as_view()
response = registration_view(request)
self.assertEqual(response.status_code, 200)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment