Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save michaelrice/add5068a5c31ea36c960f0cc82fa84b7 to your computer and use it in GitHub Desktop.
Save michaelrice/add5068a5c31ea36c960f0cc82fa84b7 to your computer and use it in GitHub Desktop.
class GifViewsTest(TestCase):
def setUp(self):
self.user = CustomUser(username="test1", password="passthis")
self.user.save()
self.user.full_clean()
def test_logged_in_index_uses_correct_template(self):
self.client.login(
username=self.user.username,
password=self.user.password
)
response = self.client.get(reverse("index"))
self.assertEqual(response.status_code, 200)
####################################
#
# Result:
# AssertionError: 302 != 200
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment