diff options
Diffstat (limited to 'mediagoblin/tests/test_misc.py')
-rw-r--r-- | mediagoblin/tests/test_misc.py | 26 |
1 files changed, 11 insertions, 15 deletions
diff --git a/mediagoblin/tests/test_misc.py b/mediagoblin/tests/test_misc.py index 776affc6..755d863f 100644 --- a/mediagoblin/tests/test_misc.py +++ b/mediagoblin/tests/test_misc.py @@ -14,21 +14,17 @@ # You should have received a copy of the GNU Affero General Public License # along with this program. If not, see <http://www.gnu.org/licenses/>. -from nose.tools import assert_equal - from mediagoblin.db.base import Session from mediagoblin.db.models import User, MediaEntry, MediaComment -from mediagoblin.tests.tools import get_app, \ - fixture_add_user, fixture_media_entry +from mediagoblin.tests.tools import fixture_add_user, fixture_media_entry -def test_404_for_non_existent(): - test_app = get_app(dump_old_app=False) +def test_404_for_non_existent(test_app): res = test_app.get('/does-not-exist/', expect_errors=True) - assert_equal(res.status_int, 404) + assert res.status_int == 404 -def test_user_deletes_other_comments(): +def test_user_deletes_other_comments(test_app): user_a = fixture_add_user(u"chris_a") user_b = fixture_add_user(u"chris_b") @@ -60,11 +56,11 @@ def test_user_deletes_other_comments(): cmt_cnt2 = MediaComment.query.count() # One user deleted - assert_equal(usr_cnt2, usr_cnt1 - 1) + assert usr_cnt2 == usr_cnt1 - 1 # One media gone - assert_equal(med_cnt2, med_cnt1 - 1) + assert med_cnt2 == med_cnt1 - 1 # Three of four comments gone. - assert_equal(cmt_cnt2, cmt_cnt1 - 3) + assert cmt_cnt2 == cmt_cnt1 - 3 User.query.get(user_b.id).delete() @@ -73,14 +69,14 @@ def test_user_deletes_other_comments(): cmt_cnt2 = MediaComment.query.count() # All users gone - assert_equal(usr_cnt2, usr_cnt1 - 2) + assert usr_cnt2 == usr_cnt1 - 2 # All media gone - assert_equal(med_cnt2, med_cnt1 - 2) + assert med_cnt2 == med_cnt1 - 2 # All comments gone - assert_equal(cmt_cnt2, cmt_cnt1 - 4) + assert cmt_cnt2 == cmt_cnt1 - 4 -def test_media_deletes_broken_attachment(): +def test_media_deletes_broken_attachment(test_app): user_a = fixture_add_user(u"chris_a") media = fixture_media_entry(uploader=user_a.id, save=False) |