Change Notification.object_id to be ID of Comemnt not TextComment

This shouldn't really effect much but it is a needed change for the future
this changes the Notification.object_id to be the ID of the Comment (the link
table to the comment object) rather than TextComment (the comment object itself).

This is needed as now comments can be other things, other than TextComment.
This commit is contained in:
Jessica Tallon
2016-02-29 12:03:41 +00:00
parent 6d38b1858c
commit 6efcab2d69
7 changed files with 118 additions and 29 deletions

View File

@@ -110,8 +110,8 @@ class TestNotifications:
assert notification.seen == False
assert notification.user_id == user.id
assert notification.obj().get_actor.id == self.test_user.id
assert notification.obj().content == u'Test comment #42'
assert notification.obj().comment().get_actor.id == self.test_user.id
assert notification.obj().comment().content == u'Test comment #42'
if wants_email == True:
# Why the `or' here? In Werkzeug 0.11.0 and above
@@ -142,7 +142,7 @@ otherperson@example.com\n\nSGkgb3RoZXJwZXJzb24sCmNocmlzIGNvbW1lbnRlZCBvbiB5b3VyI
# Save the ids temporarily because of DetachedInstanceError
notification_id = notification.id
comment_id = notification.obj().get_comment_link().id
comment_id = notification.obj().id
self.logout()
self.login('otherperson', 'nosreprehto')