'startapp validates that app name is a valid Python identifier.'

def test_invalid_name(self):

    for bad_name in ('7testproject', '../testproject'):
        args = ['startapp', bad_name]
        testproject_dir = os.path.join(self.test_dir, bad_name)
        self.addCleanup(shutil.rmtree, testproject_dir, True)
        (out, err) = self.run_django_admin(args)
        self.assertOutput(err, "CommandError:    '{}'    is    not    a    valid    app    name.    Please    make    sure    the    name    is    a    valid    identifier.".format(bad_name))
        self.assertFalse(os.path.exists(testproject_dir))
