def default_prefixer():
 request = http.HttpRequest()
 request.META['SCRIPT_NAME'] = ''
 prefixer = amo.urlresolvers.Prefixer(request)
 prefixer.app = settings.DEFAULT_APP
 prefixer.locale = settings.LANGUAGE_CODE
 amo.urlresolvers.set_url_prefix(prefixer)

def default_prefixer ( ) : request = http . HttpRequest ( ) request . META [ 'SCRIPT_NAME' ] = '' prefixer = amo . urlresolvers . Prefixer ( request ) prefixer . app = settings . DEFAULT_APP prefixer . locale = settings . LANGUAGE_CODE amo . urlresolvers . set_url_prefix ( prefixer )
make sure each test starts with a default url prefixer .