예제 #1
0
파일: tests.py 프로젝트: jatsu/djangorecipe
 def test_script(self, execute_manager):
     # The manage script is a replacement for the default manage.py
     # script. It has all the same bells and whistles since all it
     # does is call the normal Django stuff.
     from djangorecipe import manage
     manage.main('cheeseshop.development')
     self.assertEqual(execute_manager.call_args, ((self.settings, ), {}))
예제 #2
0
 def test_script(self, execute_manager):
     # The manage script is a replacement for the default manage.py
     # script. It has all the same bells and whistles since all it
     # does is call the normal Django stuff.
     manage.main('cheeseshop.development')
     self.assertEqual(execute_manager.call_args, 
                      ((self.settings,), {}))
예제 #3
0
    def test_script(self, mock_setdefault, mock_execute):
        # The manage script is a replacement for the default manage.py
        # script. It has all the same bells and whistles since all it
        # does is call the normal Django stuff.
        from djangorecipe import manage

        manage.main("cheeseshop.development")
        self.assertEqual(mock_execute.call_args, ((sys.argv,), {}))
        self.assertEqual(mock_setdefault.call_args, (("DJANGO_SETTINGS_MODULE", "cheeseshop.development"), {}))
예제 #4
0
 def test_script(self, mock_setdefault, mock_execute):
     # The manage script is a replacement for the default manage.py
     # script. It has all the same bells and whistles since all it
     # does is call the normal Django stuff.
     from djangorecipe import manage
     manage.main('cheeseshop.development')
     self.assertEqual(mock_execute.call_args, ((sys.argv, ), {}))
     self.assertEqual(
         mock_setdefault.call_args,
         (('DJANGO_SETTINGS_MODULE', 'cheeseshop.development'), {}))
예제 #5
0
 def test_django_pre_14_selection(self, mock_14, mock_pre_14):
     from djangorecipe import manage
     manage.main('cheeseshop.development')
     self.assertTrue(mock_14.called)
     self.assertFalse(mock_pre_14.called)
예제 #6
0
 def test_settings_error(self, sys_exit):
     # When the settings file cannot be imported the management
     # script it wil exit with a message and a specific exit code.
     manage.main('cheeseshop.tilsit')
     self.assertEqual(sys_exit.call_args, ((1,), {}))