-skip persona test is requests is not installed
authorRodney Ewing <ewing.rj@gmail.com>
Mon, 19 Aug 2013 21:33:07 +0000 (14:33 -0700)
committerRodney Ewing <ewing.rj@gmail.com>
Mon, 19 Aug 2013 21:33:07 +0000 (14:33 -0700)
- should use request.urlgen for location

mediagoblin/tests/test_persona.py
mediagoblin/user_pages/views.py

index ce795258030d772081b9be5b15b5f470a9f7a547..919877c9e76d2b39c449bb5ea3d90f4b94faee27 100644 (file)
@@ -18,6 +18,8 @@ import pkg_resources
 import pytest
 import mock
 
+pytest.importorskip("requests")
+
 from mediagoblin import mg_globals
 from mediagoblin.db.base import Session
 from mediagoblin.tests.tools import get_app
index 9d3cb08b5b58e09bf552dc85b72890ec332d748c..49691a2990dee937dde385856400181cda7d56e3 100644 (file)
@@ -305,8 +305,9 @@ def media_confirm_delete(request, media):
             if not location:
                 location=media.url_to_prev(request.urlgen)
             if not location:
-                location="mediagoblin.user_pages.user_home"
-            return redirect(request, location=location, user=username)
+                location=request.urlgen("mediagoblin.user_pages.user_home",
+                                        user=username)
+            return redirect(request, location=location)
         else:
             messages.add_message(
                 request, messages.ERROR,