from tastypie import http
from tastypie.authorization import Authorization
from test_utils import RequestFactory

from amo.tests import TestCase
from mkt.api.base import MarketplaceResource


class TestMarketplace(TestCase):
    def setUp(self):
        self.resource = MarketplaceResource()
        self.resource._meta.authorization = Authorization()
        self.request = RequestFactory().post('/')

    def test_form_encoded(self):
        """
        Regression test of bug #858403: ensure that a 400 (and not 500) is
        raised when an unsupported Content-Type header is passed to an API
        endpoint.
        """
        self.request.META['CONTENT_TYPE'] = 'application/x-www-form-urlencoded'
        with self.assertImmediate(http.HttpBadRequest):
            self.resource.dispatch('list', self.request)

@@ -19,16 +19,67 @@
 rt http%0A
+from tastypie.authentication import Authentication%0A
 from tas
@@ -335,16 +335,150 @@
 source()
+%0A%0A        # Ensure that we have proper authentication and authorization.%0A        self.resource._meta.authentication = Authentication()
 %0A       
@@ -522,32 +522,33 @@
 Authorization()%0A
+%0A
         self.req

Fix failing TestMarketplace test by ensuring vanilla authentication and authorization