Dot-Notation for MediaEntry.state
authorElrond <elrond+mediagoblin.org@samba-tng.org>
Tue, 13 Dec 2011 09:49:51 +0000 (10:49 +0100)
committerElrond <elrond+mediagoblin.org@samba-tng.org>
Wed, 4 Jan 2012 10:57:39 +0000 (11:57 +0100)
mediagoblin/processing.py
mediagoblin/tests/test_submission.py

index 7dd5cc7dacf06f47eae3ec075761253d2c279617..cbac80300a024ededbff6d9869cc06bf8fdb1b45 100644 (file)
@@ -64,7 +64,7 @@ class ProcessMedia(Task):
         except ImportError, exc:
             mark_entry_failed(entry[u'_id'], exc)
 
-        entry['state'] = u'processed'
+        entry.state = u'processed'
         entry.save()
 
     def on_failure(self, exc, task_id, args, kwargs, einfo):
index 4a0543a86e7e4e30e243cb5a4c1f6507ef1c6da3..2b17c5159dc323b6cc236f539209feed36749ad8 100644 (file)
@@ -240,7 +240,7 @@ class TestSubmission:
 
         entry = mg_globals.database.MediaEntry.find_one(
             {'title': 'Malicious Upload 2'})
-        assert_equal(entry['state'], 'failed')
+        assert_equal(entry.state, 'failed')
         assert_equal(
             entry['fail_error'],
             u'mediagoblin.processing:BadMediaFail')
@@ -260,7 +260,7 @@ class TestSubmission:
 
         entry = mg_globals.database.MediaEntry.find_one(
             {'title': 'Malicious Upload 3'})
-        assert_equal(entry['state'], 'failed')
+        assert_equal(entry.state, 'failed')
         assert_equal(
             entry['fail_error'],
             u'mediagoblin.processing:BadMediaFail')