A more reliable test, check against expected keys, rather than received
[mediagoblin.git] / mediagoblin / tests / test_collections.py
index b19f63627297d9251e9a2ba529de0ff50d109f0a..87782f307ca84038425eecc2921c24b3ce1ef919 100644 (file)
 # 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 mediagoblin.tests.tools import fixture_add_collection, fixture_add_user, \
-    get_app
+from mediagoblin.tests.tools import fixture_add_collection, fixture_add_user
 from mediagoblin.db.models import Collection, User
-from mediagoblin.db.base import Session
-from nose.tools import assert_equal
 
 
-def test_user_deletes_collection():
+def test_user_deletes_collection(test_app):
     # Setup db.
-    get_app(dump_old_app=False)
-
     user = fixture_add_user()
     coll = fixture_add_collection(user=user)
     # Reload into session:
@@ -34,4 +29,4 @@ def test_user_deletes_collection():
     user.delete()
     cnt2 = Collection.query.count()
 
-    assert_equal(cnt1, cnt2 + 1)
+    assert cnt1 == cnt2 + 1