from django.contrib.auth.models import User
from django.test import TestCase

class LoginTest(TestCase):
    def setUp(self):
        self.user = User.objects.create_user(
            'test', 'test@test.com', 'password')

    def tearDown(self):
        self.user.delete()

    def test_login_view(self):
        response = self.client.post(
            '/accounts/login/',
            {
                'username': 'test',
                'password': 'password',
            })

        self.assertRedirects(response, '/')

from django.contrib.auth.models import User
from django.core.urlresolvers import reverse
from django.test import TestCase

class LoginTest(TestCase):
    def setUp(self):
        self.user = User.objects.create_user(
            'test', 'test@test.com', 'password')

    def tearDown(self):
        self.user.delete()

    def test_login_view(self):
        response = self.client.post(
            '/accounts/login/',
            {
                'username': 'test',
                'password': 'password',
            })

        self.assertRedirects(response, '/')

    def test_password_reset_view(self):
        response = self.client.get(reverse('password_reset'))
        self.assertEquals(response.status_code, 200)

Add test to check that password reset view loads fine
Add test to check that password reset view loads fine

  from django.contrib.auth.models import User
+ from django.core.urlresolvers import reverse
  from django.test import TestCase
  
  class LoginTest(TestCase):
      def setUp(self):
          self.user = User.objects.create_user(
              'test', 'test@test.com', 'password')
  
      def tearDown(self):
          self.user.delete()
  
      def test_login_view(self):
          response = self.client.post(
              '/accounts/login/',
              {
                  'username': 'test',
                  'password': 'password',
              })
  
          self.assertRedirects(response, '/')
  
+     def test_password_reset_view(self):
+         response = self.client.get(reverse('password_reset'))
+         self.assertEquals(response.status_code, 200)
+ 
Add test to check that password reset view loads fine
## Code Before:
from django.contrib.auth.models import User
from django.test import TestCase

class LoginTest(TestCase):
    def setUp(self):
        self.user = User.objects.create_user(
            'test', 'test@test.com', 'password')

    def tearDown(self):
        self.user.delete()

    def test_login_view(self):
        response = self.client.post(
            '/accounts/login/',
            {
                'username': 'test',
                'password': 'password',
            })

        self.assertRedirects(response, '/')

## Instruction:
Add test to check that password reset view loads fine
## Code After:
from django.contrib.auth.models import User
from django.core.urlresolvers import reverse
from django.test import TestCase

class LoginTest(TestCase):
    def setUp(self):
        self.user = User.objects.create_user(
            'test', 'test@test.com', 'password')

    def tearDown(self):
        self.user.delete()

    def test_login_view(self):
        response = self.client.post(
            '/accounts/login/',
            {
                'username': 'test',
                'password': 'password',
            })

        self.assertRedirects(response, '/')

    def test_password_reset_view(self):
        response = self.client.get(reverse('password_reset'))
        self.assertEquals(response.status_code, 200)
