'Test index page with login at /projects/add/'

def test_project_add(self):

    response = self.client.get(reverse('project_add'))
    self.assertEquals(response.status_code, 200)
    self.assertEqual(type(response.context['form']), ProjectForm)
    projects_qty = Project.objects.count()
    form_params = {'name': 'project_name', 'details': 'new    project    details'}
    response = self.client.post(reverse('project_add'), data=form_params)
    self.assertEquals(response.status_code, 302)
    project_id = response['Location'].split('/')[(-1)]
    self.assertRedirects(response, reverse('projects_project_view', args=[project_id]))
    self.assertEqual(Project.objects.count(), (projects_qty + 1))
    project = Project.objects.get(id=project_id)
    self.assertEqual(project.name, form_params['name'])
    self.assertEqual(project.details, form_params['details'])
