'If a project exists with same name, expect a failure importing demo
This should be edge case, user would have to import a project (not the
demo project), named user-demo, and then manually enter the demo import
URL, as the onboarding isn\'t shown when projects > 0'

def test_import_demo_imported_duplicate(self):

    self.test_import_demo_pass()
    project = Project.objects.get(slug='eric-demo')
    project.repo = 'file:///foobar'
    project.save()
    resp = self.client.get('/dashboard/import/manual/demo/')
    self.assertEqual(resp.status_code, 302)
    self.assertEqual(resp['Location'], '/dashboard/')
    resp_redir = self.client.get(resp['Location'])
    self.assertEqual(resp_redir.status_code, 200)
    messages = list(resp_redir.context['messages'])
    self.assertEqual(messages[0].level, message_const.ERROR)
    self.assertRegexpMatches(messages[0].message, 'There    was    a    problem')
    self.assertEqual(project, Project.objects.get(slug='eric-demo'))
