~ubuntuone-pqm-team/django/stable

« back to all changes in this revision

Viewing changes to tests/admin_scripts/tests.py

  • Committer: Natalia
  • Date: 2016-05-03 13:51:18 UTC
  • Revision ID: natalia.bidart@ubuntu.com-20160503135118-5yv5ywnfpqv6onnc
- Imported Django 1.9.6 from released tarball.

Show diffs side-by-side

added added

removed removed

Lines of Context:
181
181
                pass
182
182
 
183
183
        conf_dir = os.path.dirname(upath(conf.__file__))
184
 
        template_manage_py = os.path.join(conf_dir, 'project_template', 'manage.py')
 
184
        template_manage_py = os.path.join(conf_dir, 'project_template', 'manage.py-tpl')
185
185
 
186
186
        test_manage_py = os.path.join(self.test_dir, 'manage.py')
187
187
        shutil.copyfile(template_manage_py, test_manage_py)
610
610
        self.addCleanup(shutil.rmtree, app_path)
611
611
        self.assertNoOutput(err)
612
612
        self.assertTrue(os.path.exists(app_path))
 
613
        unicode_literals_import = "from __future__ import unicode_literals\n"
613
614
        with open(os.path.join(app_path, 'apps.py'), 'r') as f:
614
615
            content = f.read()
615
616
            self.assertIn("class SettingsTestConfig(AppConfig)", content)
616
617
            self.assertIn("name = 'settings_test'", content)
 
618
            if not PY3:
 
619
                self.assertIn(unicode_literals_import, content)
617
620
        if not PY3:
618
621
            with open(os.path.join(app_path, 'models.py'), 'r') as fp:
619
622
                content = fp.read()
620
 
            self.assertIn(
621
 
                "from __future__ import unicode_literals\n",
622
 
                content,
623
 
            )
 
623
            self.assertIn(unicode_literals_import, content)
624
624
 
625
625
    def test_setup_environ_custom_template(self):
626
626
        "directory: startapp creates the correct directory with a custom template"