import pytest
-import urlparse
+import six.moves.urllib.parse as urlparse
from mediagoblin.tools import template, mail
# TODO: Possibly abstract into a decorator like:
# @as_authenticated_user('chris')
- self.test_user = fixture_add_user()
+ self.test_user = fixture_add_user(privileges=[u'active',u'commenter'])
self.current_user = None
'''
user = fixture_add_user('otherperson', password='nosreprehto',
- wants_comment_notification=wants_email)
+ wants_comment_notification=wants_email,
+ privileges=[u'active',u'commenter'])
+
+ assert user.wants_comment_notification == wants_email
user_id = user.id
else:
assert mail.EMAIL_TEST_MBOX_INBOX == []
+
# Save the ids temporarily because of DetachedInstanceError
notification_id = notification.id
comment_id = notification.subject.id
self.logout()
self.login('otherperson', 'nosreprehto')
- self.test_app.get(media_uri_slug + '/c/{0}/'.format(comment_id))
+ self.test_app.get(media_uri_slug + 'c/{0}/'.format(comment_id))
notification = Notification.query.filter_by(id=notification_id).first()
assert notification.seen == True
- self.test_app.get(media_uri_slug + '/notifications/silence/')
+ self.test_app.get(media_uri_slug + 'notifications/silence/')
subscription = CommentSubscription.query.filter_by(id=subscription_id)\
.first()
def test_mark_all_comment_notifications_seen(self):
""" Test that mark_all_comments_seen works"""
- user = fixture_add_user('otherperson', password='nosreprehto')
+ user = fixture_add_user('otherperson', password='nosreprehto',
+ privileges=[u'active'])
media_entry = fixture_media_entry(uploader=user.id, state=u'processed')