Esempio n. 1
0
 def test_update_comments_viewed_timestamp_none(self):
     user = UserFactory()
     user.comments_viewed_timestamp = {}
     user.save()
     update_comments_viewed_timestamp()
     user.reload()
     assert_equal(user.comments_viewed_timestamp, {})
 def test_update_comments_viewed_timestamp_none(self):
     user = UserFactory()
     user.comments_viewed_timestamp = {}
     user.save()
     update_comments_viewed_timestamp()
     user.reload()
     assert_equal(user.comments_viewed_timestamp, {})
 def test_update_comments_viewed_timestamp(self):
     user = UserFactory()
     timestamp = datetime.utcnow().replace(microsecond=0)
     user.comments_viewed_timestamp = {'abc123': timestamp}
     user.save()
     update_comments_viewed_timestamp()
     user.reload()
     assert_equal(user.comments_viewed_timestamp, {'abc123': {'node': timestamp}})
Esempio n. 4
0
 def test_update_comments_viewed_timestamp(self):
     user = UserFactory()
     timestamp = datetime.utcnow().replace(microsecond=0)
     user.comments_viewed_timestamp = {'abc123': timestamp}
     user.save()
     update_comments_viewed_timestamp()
     user.reload()
     assert_equal(user.comments_viewed_timestamp,
                  {'abc123': {
                      'node': timestamp
                  }})
Esempio n. 5
0
 def test_update_comments_viewed_timestamp(self):
     user = UserFactory()
     timestamp = timezone.now().replace(microsecond=0)
     user.comments_viewed_timestamp = {
         'node_id': {
             'node': timestamp,
             'files': {
                 'file_id_1': timestamp,
                 'file_id_2': timestamp,
             }
         }
     }
     user.save()
     update_comments_viewed_timestamp()
     user.reload()
     assert_equal(user.comments_viewed_timestamp, {
         'node_id': timestamp,
         'file_id_1': timestamp,
         'file_id_2': timestamp
     })