Ejemplo 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, {})
Ejemplo n.º 2
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, {})
Ejemplo n.º 3
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}})
Ejemplo 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
                  }})
Ejemplo 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
     })