Пример #1
0
 def test_main_default(self):
     with listen() as registry:
         main(['app_manage'], argv=['manage.py', 'app_manage_test'])
         self.assertEqual(registry, [
             (
                 (),
                 {
                     'settings': None,
                     'verbosity': '1',
                     'pythonpath': None,
                     'no_color': False,
                     'traceback': None,
                     'my_flag': 'flag-no-set'
                 }
             )
         ])
Пример #2
0
 def test_main_config(self):
     with listen() as registry:
         main(
             ['app_manage'],
             argv=['manage.py', 'app_manage_test', '--config', 'myvalue'],
             TEST_SETTING=Config(arg='--config', default=None)
         )
         from django.conf import settings
         self.assertEqual(settings.TEST_SETTING, 'myvalue')
         self.assertEqual(registry, [
             (
                 (),
                 {
                     'settings': None,
                     'verbosity': '1',
                     'pythonpath': None,
                     'no_color': False,
                     'traceback': None,
                     'my_flag': 'flag-no-set'
                 }
             )
         ])