def _set_stubs(self):
        self.mock_config = MockGlobalConfig()
        self.god.stub_with(global_config, "global_config", self.mock_config)

        self.mock_drone_manager = MockDroneManager()
        drone_manager._set_instance(self.mock_drone_manager)

        self.mock_email_manager = MockEmailManager()
        self.god.stub_with(email_manager, "manager", self.mock_email_manager)

        self._database = database_connection.TranslatingDatabase.get_test_database(translators=_DB_TRANSLATORS)
        self._database.connect(db_type="django")
        self.god.stub_with(monitor_db, "_db", self._database)
        self.god.stub_with(scheduler_models, "_db", self._database)

        monitor_db.initialize_globals()
        scheduler_models.initialize_globals()
예제 #2
0
    def _set_stubs(self):
        self.mock_config = MockGlobalConfig()
        self.god.stub_with(settings, 'settings', self.mock_config)

        self.mock_drone_manager = MockDroneManager()
        drone_manager._set_instance(self.mock_drone_manager)

        self.mock_email_manager = MockEmailManager()
        self.god.stub_with(mail, "manager", self.mock_email_manager)

        self._database = (
            database_connection.TranslatingDatabase.get_test_database(
                translators=_DB_TRANSLATORS))
        self._database.connect(db_type='django')
        self.god.stub_with(monitor_db, '_db', self._database)
        self.god.stub_with(scheduler_models, '_db', self._database)

        monitor_db.initialize_globals()
        scheduler_models.initialize_globals()