Fix #5376 - Ensure links have correct ID

This ensures that links to comments have the correct ID (the
ID of the Comment object) as well as fixing deletion on reports
and fixing a few other little things. I hope this fixes the #5376
issue, though cannot reproduce so unable to confirm.
This commit is contained in:
Jessica Tallon
2016-03-01 11:58:38 +00:00
parent 1db8690fe9
commit 161bc6b2c1
7 changed files with 25 additions and 24 deletions

View File

@@ -317,7 +317,7 @@ class TestAPI(object):
# Find the objects in the database
media = MediaEntry.query.filter_by(public_id=data["object"]["id"]).first()
comment = media.get_comments()[0]
comment = media.get_comments()[0].comment()
# Tests that it matches in the database
assert comment.actor == self.user.id

View File

@@ -64,13 +64,13 @@ def test_user_deletes_other_comments(test_app):
usr_cnt1 = User.query.count()
med_cnt1 = MediaEntry.query.count()
cmt_cnt1 = TextComment.query.count()
cmt_cnt1 = Comment.query.count()
User.query.get(user_a.id).delete(commit=False)
usr_cnt2 = User.query.count()
med_cnt2 = MediaEntry.query.count()
cmt_cnt2 = TextComment.query.count()
cmt_cnt2 = Comment.query.count()
# One user deleted
assert usr_cnt2 == usr_cnt1 - 1
@@ -83,7 +83,7 @@ def test_user_deletes_other_comments(test_app):
usr_cnt2 = User.query.count()
med_cnt2 = MediaEntry.query.count()
cmt_cnt2 = TextComment.query.count()
cmt_cnt2 = Comment.query.count()
# All users gone
assert usr_cnt2 == usr_cnt1 - 2