예제 #1
0
파일: test_scaffold.py 프로젝트: tjguk/opal
 def test_sets_random_secret_key(self, os, subpr):
     with patch.object(scaffold, 'get_random_secret_key') as rnd:
         rnd.return_value = 'MyRandomKey'
         scaffold.startproject(self.args, self.path)
         settings = self.path / 'testapp/testapp/settings.py'
         self.assertTrue("SECRET_KEY = 'MyRandomKey'" in settings.contents)
         rnd.assert_called_with()
예제 #2
0
파일: test_scaffold.py 프로젝트: tjguk/opal
 def test_calls_interpolate_dir(self, os, subpr):
     with patch.object(scaffold, 'interpolate_dir') as interpolate:
         with patch.object(scaffold, 'get_random_secret_key') as rnd:
             rnd.return_value = 'foobarbaz'
             scaffold.startproject(self.args, self.path)
             interpolate.assert_any_call(self.path / 'testapp',
                                         name='testapp',
                                         secret_key='foobarbaz')
예제 #3
0
파일: test_scaffold.py 프로젝트: tjguk/opal
 def test_has_named_templates_dir(self, os, subpr):
     scaffold.startproject(self.args, self.path)
     templates = self.path / 'testapp/testapp/templates/testapp'
     self.assertTrue(templates.is_dir)
예제 #4
0
파일: test_scaffold.py 프로젝트: tjguk/opal
 def test_js_has_flow(self, os, subpr):
     scaffold.startproject(self.args, self.path)
     flow = self.path / 'testapp/testapp/static/js/testapp/flow.js'
     self.assertTrue(flow.is_file)
예제 #5
0
파일: test_scaffold.py 프로젝트: tjguk/opal
 def test_has_js_routes(self, os, subpr):
     scaffold.startproject(self.args, self.path)
     routes = self.path / 'testapp/testapp/static/js/testapp/routes.js'
     self.assertTrue(routes.is_file)
예제 #6
0
파일: test_scaffold.py 프로젝트: tjguk/opal
 def test_has_css_dir(self, os, subpr):
     scaffold.startproject(self.args, self.path)
     css_dir = self.path / 'testapp/testapp/static/css'
     self.assertTrue(css_dir.is_dir)
예제 #7
0
파일: test_scaffold.py 프로젝트: tjguk/opal
 def test_settings_is_our_settings(self, os, subpr):
     scaffold.startproject(self.args, self.path)
     settings = self.path / 'testapp/testapp/settings.py'
     self.assertTrue('opal' in settings.contents)
예제 #8
0
파일: test_scaffold.py 프로젝트: tjguk/opal
 def test_has_lookuplists_dir(self, os, subpr):
     lookuplists = self.path / 'testapp/data/lookuplists'
     scaffold.startproject(self.args, self.path)
     self.assertTrue(lookuplists.is_dir)
예제 #9
0
파일: test_scaffold.py 프로젝트: tjguk/opal
 def test_has_gitignore(self, os, subpr):
     scaffold.startproject(self.args, self.path)
     gitignore = self.path / 'testapp/.gitignore'
     self.assertTrue(gitignore.is_file)
예제 #10
0
파일: test_scaffold.py 프로젝트: tjguk/opal
 def test_bail_if_exists(self, os, sub):
     preexisting = self.path / 'testapp'
     preexisting.mkdir()
     with patch.object(scaffold.sys, 'exit') as exiter:
         scaffold.startproject(self.args, self.path)
         exiter.assert_called_with(1)
예제 #11
0
파일: test_scaffold.py 프로젝트: tjguk/opal
 def test_run_django_startproject(self, os, subpr):
     scaffold.startproject(self.args, self.path)
     os.assert_any_call('django-admin.py startproject testapp')
예제 #12
0
파일: test_scaffold.py 프로젝트: tjguk/opal
 def test_initialize_git(self, os, subpr):
     scaffold.startproject(self.args, self.path)
     os.assert_any_call('cd testapp; git init')
예제 #13
0
파일: test_scaffold.py 프로젝트: tjguk/opal
 def test_sets_settings(self, os, subpr):
     with patch.object(scaffold, '_set_settings_module') as settings:
         scaffold.startproject(self.args, self.path)
         settings.assert_called_with('testapp')
예제 #14
0
파일: test_scaffold.py 프로젝트: tjguk/opal
 def test_runs_migrate(self, os, subpr):
     scaffold.startproject(self.args, self.path)
     subpr.assert_any_call(
         ['python', 'testapp/manage.py', 'migrate', '--traceback'])
예제 #15
0
파일: test_scaffold.py 프로젝트: tjguk/opal
 def test_has_assets_readme(self, os, subpr):
     scaffold.startproject(self.args, self.path)
     readme = self.path / 'testapp/testapp/assets/README.md'
     self.assertTrue(readme.is_file)
예제 #16
0
파일: test_scaffold.py 프로젝트: tjguk/opal
 def test_has_assets_dir(self, os, subpr):
     scaffold.startproject(self.args, self.path)
     assets = self.path / 'testapp/testapp/assets'
     self.assertTrue(assets.is_dir)