@@ -76,7 +76,7 @@ def setUp(self):
76
76
'social_orcid' : None ,
77
77
'social_researchgate' : None ,
78
78
'social_googlescholar' : None ,
79
- 'creation_timestamp' : None
79
+ 'creation_timestamp' : datetime ( 2015 , 12 , 3 , 13 , 52 , 42 , 751331 )
80
80
}
81
81
82
82
def tearDown (self ):
@@ -265,8 +265,19 @@ def test_get_info(self):
265
265
'social_orcid' : None ,
266
266
'social_researchgate' : None ,
267
267
'social_googlescholar' : None ,
268
- 'creation_timestamp' : None
268
+ 'creation_timestamp' : datetime ( 2015 , 12 , 3 , 13 , 52 , 42 , 751331 )
269
269
}
270
+
271
+ # test database is re-populated during testing several times.
272
+ # Creation_timestamp depends on the percise timing of the repopulation,
273
+ # i.e. we cannot predict its value. We just test that this date should
274
+ # be within an hour and now. For the remainder of tests, we update
275
+ # our expectation.
276
+ self .assertTrue (datetime .now () - timedelta (hours = 1 ) <
277
+ self .user .info ['creation_timestamp' ] <
278
+ datetime .now ())
279
+ expinfo ['creation_timestamp' ] = self .user .info ['creation_timestamp' ]
280
+
270
281
self .assertEqual (self .user .info , expinfo )
271
282
272
283
def test_set_info (self ):
0 commit comments