'Make sure the startproject management command validates a project name'

def test_invalid_project_name(self):

    for bad_name in (u'7testproject', u'../testproject'):
        args = [u'startproject', bad_name]
        testproject_dir = os.path.join(test_dir, bad_name)
        self.addCleanup(shutil.rmtree, testproject_dir, True)
        (out, err) = self.run_django_admin(args)
        self.assertOutput(err, (u"Error:    '%s'    is    not    a    valid    project    name.    Please    make    sure    the    name    begins    with    a    letter    or    underscore." % bad_name))
        self.assertFalse(os.path.exists(testproject_dir))
