Mock get_auto_id function when run unit test 79/57679/1
authorfujinhua <fu.jinhua@zte.com.cn>
Thu, 26 Jul 2018 09:38:54 +0000 (17:38 +0800)
committerfujinhua <fu.jinhua@zte.com.cn>
Thu, 26 Jul 2018 09:38:54 +0000 (17:38 +0800)
Change-Id: Iabbcf576295339eeed21c2e091c7f910e2b85dad
Issue-ID: VFC-986
Signed-off-by: fujinhua <fu.jinhua@zte.com.cn>
catalog/settings.py

index c8f7e0b..8f4f36b 100644 (file)
@@ -182,3 +182,8 @@ if 'test' in sys.argv:
         TEST_OUTPUT_VERBOSE = True
         TEST_OUTPUT_DESCRIPTIONS = True
         TEST_OUTPUT_DIR = 'test-reports'
+
+    import mock
+    from catalog.pub.utils import idutil
+    idutil.get_auto_id = mock.Mock()
+    idutil.get_auto_id.return_value = 1