context = template.TEMPLATE_TEST_CONTEXT['mediagoblin/user_pages/user.html']
request = context['request']
media = request.db.MediaEntry.find({'title': 'Balanced Goblin'})[0]
- assert_equal(media['tags'],
+ assert_equal(media.tags,
[{'name': u'yin', 'slug': u'yin'},
{'name': u'yang', 'slug': u'yang'}])
{'title': 'Malicious Upload 2'})
assert_equal(entry.state, 'failed')
assert_equal(
- entry['fail_error'],
+ entry.fail_error,
u'mediagoblin.processing:BadMediaFail')
# Test non-supported file with .png extension
{'title': 'Malicious Upload 3'})
assert_equal(entry.state, 'failed')
assert_equal(
- entry['fail_error'],
+ entry.fail_error,
u'mediagoblin.processing:BadMediaFail')
assert request.method == 'POST'
comment = request.db.MediaComment()
- comment['media_entry'] = media._id
- comment['author'] = request.user._id
- comment['content'] = unicode(request.POST['comment_content'])
+ comment.media_entry = media.id
+ comment.author = request.user.id
+ comment.content = unicode(request.POST['comment_content'])
- if not comment['content'].strip():
+ if not comment.content.strip():
messages.add_message(
request,
messages.ERROR,