Beispiel #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)
Beispiel #2
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)
Beispiel #3
0
    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()
Beispiel #4
0
    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()
Beispiel #5
0
 def handle(self, *args, **kwargs):
     update_db()