@@ -0,0 +1,2185 @@
+# -*- coding: utf-8 -*-%0A%0A# This work was created by participants in the DataONE project, and is%0A# jointly copyrighted by participating institutions in DataONE. For%0A# more information on DataONE, see our web site at http://dataone.org.%0A#%0A#   Copyright 2009-2016 DataONE%0A#%0A# Licensed under the Apache License, Version 2.0 (the %22License%22);%0A# you may not use this file except in compliance with the License.%0A# You may obtain a copy of the License at%0A#%0A#   http://www.apache.org/licenses/LICENSE-2.0%0A#%0A# Unless required by applicable law or agreed to in writing, software%0A# distributed under the License is distributed on an %22AS IS%22 BASIS,%0A# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.%0A# See the License for the specific language governing permissions and%0A# limitations under the License.%0A%22%22%22Test the bulk importer management command%0A%22%22%22%0Afrom __future__ import absolute_import%0A%0Aimport responses%0A%0Aimport d1_gmn.tests.gmn_test_case%0A%0Aimport d1_test.d1_test_case%0Aimport d1_test.mock_api.get as mock_get%0Aimport d1_test.mock_api.get_log_records as mock_log_records%0Aimport d1_test.mock_api.get_system_metadata as mock_get_system_metadata%0Aimport d1_test.mock_api.list_objects as mock_object_list%0A%0Aimport django%0Aimport django.core.management%0A%0A%0A@d1_test.d1_test_case.reproducible_random_decorator('TestMgmtImport')%0Aclass TestMgmtImport(d1_gmn.tests.gmn_test_case.GMNTestCase):%0A  @responses.activate%0A  def test_1000(self):%0A    mock_object_list.add_callback(d1_test.d1_test_case.MOCK_REMOTE_BASE_URL)%0A    mock_log_records.add_callback(d1_test.d1_test_case.MOCK_REMOTE_BASE_URL)%0A    mock_get_system_metadata.add_callback(%0A      d1_test.d1_test_case.MOCK_REMOTE_BASE_URL%0A    )%0A    mock_get.add_callback(d1_test.d1_test_case.MOCK_REMOTE_BASE_URL)%0A%0A    with self.mock.disable_management_command_logging():%0A      with d1_test.d1_test_case.capture_log() as log_stream:%0A        with d1_test.d1_test_case.disable_debug_level_logging():%0A          django.core.management.call_command(%0A            'import', '--force', '--major=2',%0A            d1_test.d1_test_case.MOCK_REMOTE_BASE_URL%0A          )%0A%0A    log_str = log_stream.getvalue()%0A    self.sample.assert_equals(log_str, 'import')%0A

Add tests for bulk importer