'The L{UnsupportedMethod} raised by L{Resource.render} for an unsupported
request method has a C{allowedMethods} attribute set to the value of the
C{allowedMethods} attribute of the L{Resource}, if it has one.'

def test_explicitAllowedMethods(self):

    expected = ['GET', 'HEAD', 'PUT']
    resource = Resource()
    resource.allowedMethods = expected
    request = DummyRequest([])
    request.method = 'FICTIONAL'
    exc = self.assertRaises(UnsupportedMethod, resource.render, request)
    self.assertEqual(set(expected), set(exc.allowedMethods))
