diff options
author | Jessica Tallon <tsyesika@tsyesika.se> | 2015-10-20 12:24:54 +0000 |
---|---|---|
committer | Jessica Tallon <tsyesika@tsyesika.se> | 2015-10-20 12:24:54 +0000 |
commit | 64a456a4e50b03e4fa2b33ceb208e88d2e02fce7 (patch) | |
tree | f60658eb937886dfd1cc349cab605c13a02942e5 /mediagoblin/tests/test_notifications.py | |
parent | fd703bb4d0665958d853b89f6069eefd8a8c8113 (diff) | |
download | mediagoblin-64a456a4e50b03e4fa2b33ceb208e88d2e02fce7.tar.lz mediagoblin-64a456a4e50b03e4fa2b33ceb208e88d2e02fce7.tar.xz mediagoblin-64a456a4e50b03e4fa2b33ceb208e88d2e02fce7.zip |
Comment changes for federation
This adds a new Comment link table that is used to link between some
object and then the comment object, which can be more or less any
object in Mediagoblin. The MediaComment has been renamed to
TextComment as that more aptly describes what it is. There is
migrations for these changes.
There is also the conslidation of the Report tables into a single
Report table, the same with the Notification objects. This is because
both of them split out MediaEntry and Comment versions into their own
polymorphic versions from a base, this is no longer a meaningful
distinction as comments can be anything.
Diffstat (limited to 'mediagoblin/tests/test_notifications.py')
-rw-r--r-- | mediagoblin/tests/test_notifications.py | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/mediagoblin/tests/test_notifications.py b/mediagoblin/tests/test_notifications.py index f7e67d80..a1dc60ed 100644 --- a/mediagoblin/tests/test_notifications.py +++ b/mediagoblin/tests/test_notifications.py @@ -20,8 +20,7 @@ import six.moves.urllib.parse as urlparse from mediagoblin.tools import template, mail -from mediagoblin.db.models import Notification, CommentNotification, \ - CommentSubscription +from mediagoblin.db.models import Notification, CommentSubscription from mediagoblin.db.base import Session from mediagoblin.notifications import mark_comment_notification_seen @@ -109,11 +108,10 @@ class TestNotifications: notification = notifications[0] - assert type(notification) == CommentNotification assert notification.seen == False assert notification.user_id == user.id - assert notification.subject.get_actor.id == self.test_user.id - assert notification.subject.content == u'Test comment #42' + assert notification.obj().get_actor.id == self.test_user.id + assert notification.obj().content == u'Test comment #42' if wants_email == True: assert mail.EMAIL_TEST_MBOX_INBOX == [ @@ -130,7 +128,7 @@ otherperson@example.com\n\nSGkgb3RoZXJwZXJzb24sCmNocmlzIGNvbW1lbnRlZCBvbiB5b3VyI # Save the ids temporarily because of DetachedInstanceError notification_id = notification.id - comment_id = notification.subject.id + comment_id = notification.obj().get_comment_link().id self.logout() self.login('otherperson', 'nosreprehto') |