From 849290a3b7dd364486f51ecb5e9226524f5a7da1 Mon Sep 17 00:00:00 2001 From: Nick Hall Date: Tue, 18 Jul 2017 00:06:30 +0100 Subject: [PATCH] Fix Pro-Gen unit test --- data/tests/SAMPLE.gramps | 14 +++++++------- gramps/plugins/importer/importprogen.py | 2 +- gramps/plugins/test/imports_test.py | 4 +++- 3 files changed, 11 insertions(+), 9 deletions(-) diff --git a/data/tests/SAMPLE.gramps b/data/tests/SAMPLE.gramps index a2c257876..e41ecaad5 100644 --- a/data/tests/SAMPLE.gramps +++ b/data/tests/SAMPLE.gramps @@ -8,13 +8,13 @@ - - - - - - - + + + + + + + diff --git a/gramps/plugins/importer/importprogen.py b/gramps/plugins/importer/importprogen.py index 9532c2d8d..96800aa8b 100644 --- a/gramps/plugins/importer/importprogen.py +++ b/gramps/plugins/importer/importprogen.py @@ -208,7 +208,7 @@ class ProgenOptions(ManagedWindow): # initial values fname = os.path.basename(filename).split('\\')[-1] - date = time.strftime("%Y-%m-%d") + date = time.strftime("%Y-%m-%d", time.localtime()) text = "Pro-Gen Import" # add import source title/confidence diff --git a/gramps/plugins/test/imports_test.py b/gramps/plugins/test/imports_test.py index 3dd8c2a06..c3a6b3948 100644 --- a/gramps/plugins/test/imports_test.py +++ b/gramps/plugins/test/imports_test.py @@ -198,10 +198,12 @@ def make_tst_function(tstfile, file_name): @patch('gramps.plugins.db.bsddb.write.time') @patch('gramps.gen.utils.unknown.localtime') @patch('gramps.gen.utils.unknown.time') - def tst(self, mocktime, mockltime, mockwtime, mockdtime): + @patch('time.localtime') + def tst(self, mockptime, mocktime, mockltime, mockwtime, mockdtime): """ This compares the import file with the expected result '.gramps' file. """ + mockptime.side_effect = mock_localtime mocktime.side_effect = mock_time mockltime.side_effect = mock_localtime mockwtime.side_effect = mock_time