예제 #1
0
 def test_update_db(self, mock_data, mock_mgmt):
     """
     Ensure update_db goes through the 2 management steps, which assumes
     there are no PROJECT_APPS, or load_initial_data is stubbed out.
     """
     dev_utils.update_db()
     self.assertEqual(mock_mgmt.call_count, 2)
     self.assertEqual(mock_data.call_count, 1)
예제 #2
0
파일: tests.py 프로젝트: nbailey/quark
 def test_update_db(self, mock_data, mock_mgmt):
     """
     Ensure update_db goes through the 2 management steps, which assumes
     there are no PROJECT_APPS, or load_initial_data is stubbed out.
     """
     dev_utils.update_db()
     self.assertEqual(mock_mgmt.call_count, 2)
     self.assertEqual(mock_data.call_count, 1)
예제 #3
0
파일: dev.py 프로젝트: nbailey/quark
    def handle(self, *args, **kwargs):
        if len(args) != 0:
            # Don't need any args
            raise CommandError("Usage: python manage.py dev")

        if os.environ.get("RUN_MAIN", False) == "true":
            # Only run update_db if this is not a thread spawned by
            # restart_with_reloader. This prevents update_db from happening
            # more than once when the management command is run. See
            # https://code.djangoproject.com/ticket/8085#comment:13
            print "Running development server"
            dev_utils.update_db()

        dev = DevServer(username=getpass.getuser())
        dev.run_server()
예제 #4
0
파일: dev.py 프로젝트: ochan1/quark
    def handle(self, *args, **kwargs):
        if len(args) != 0:
            # Don't need any args
            raise CommandError('Usage: python manage.py dev')

        if os.environ.get('RUN_MAIN', False) == 'true':
            # Only run update_db if this is not a thread spawned by
            # restart_with_reloader. This prevents update_db from happening
            # more than once when the management command is run. See
            # https://code.djangoproject.com/ticket/8085#comment:13
            print 'Running development server'
            dev_utils.update_db()

        dev = DevServer(username=getpass.getuser())
        dev.run_server()
예제 #5
0
 def handle(self, *args, **kwargs):
     update_db()