Skip to content

Commit

Permalink
fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
sjanssen2 committed Jun 20, 2024
1 parent b883817 commit 6601e24
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions qiita_db/test/test_user.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ def setUp(self):
'social_orcid': None,
'social_researchgate': None,
'social_googlescholar': None,
'creation_timestamp': None
'creation_timestamp': datetime(2015, 12, 3, 13, 52, 42, 751331)
}

def tearDown(self):
Expand Down Expand Up @@ -265,8 +265,19 @@ def test_get_info(self):
'social_orcid': None,
'social_researchgate': None,
'social_googlescholar': None,
'creation_timestamp': None
'creation_timestamp': datetime(2015, 12, 3, 13, 52, 42, 751331)
}

# test database is re-populated during testing several times.
# Creation_timestamp depends on the percise timing of the repopulation,
# i.e. we cannot predict its value. We just test that this date should
# be within an hour and now. For the remainder of tests, we update
# our expectation.
self.assertTrue(datetime.now() - timedelta(hours=1) <
self.user.info['creation_timestamp'] <
datetime.now())
expinfo['creation_timestamp'] = self.user.info['creation_timestamp']

self.assertEqual(self.user.info, expinfo)

def test_set_info(self):
Expand Down

0 comments on commit 6601e24

Please sign in to comment.