Package omeroweb :: Package webadmin :: Package tests :: Module request_factory
[hide private]
[frames] | no frames]

Module request_factory

source code

Classes [hide private]
  FakePayload
A wrapper around StringIO that restricts what can be read since data from the network can't be seeked and cannot be read outside of its content length.
  ClientHandler
A HTTP Handler that can be used for testing purposes.
  RequestFactory
Class that lets you create mock Request objects for use in testing.
  Client
A class that can act as a client for testing purposes.
Functions [hide private]
 
fakeRequest(method, path="/", params={}, **kwargs) source code
 
store_rendered_templates(store, signal, sender, template, context, **kwargs)
Stores templates and contexts that are rendered.
source code
 
encode_multipart(boundary, data)
Encodes multipart POST data from a dictionary of form values.
source code
 
encode_file(boundary, key, file) source code
Variables [hide private]
  BOUNDARY = 'BoUnDaRyStRiNg'
  MULTIPART_CONTENT = 'multipart/form-data; boundary=%s' % BOUNDARY
  CONTENT_TYPE_RE = re.compile('.*; charset=([\w\d-]+);?')

Imports: urllib, urlparse, urlunparse, urlsplit, sys, os, re, mimetypes, warnings, StringIO, settings, authenticate, login, BaseHandler, WSGIRequest, got_request_exception, SimpleCookie, HttpRequest, QueryDict, TemplateDoesNotExist, signals, curry, smart_str, urlencode, import_module, is_iterable, transaction, close_connection, ContextList, webgateway_views


Function Details [hide private]

encode_multipart(boundary, data)

source code 

Encodes multipart POST data from a dictionary of form values.

The key will be used as the form data name; the value will be transmitted as content. If the value is a file, the contents of the file will be sent as an application/octet-stream; otherwise, str(value) will be sent.