autowisp.tests.test_error_capture_middleware module

Class Inheritance Diagram

Inheritance diagram of Error, ErrorCaptureMiddleware, SimpleNamespace, TestErrorCaptureMiddleware, ViewError

Unit tests for the BUI error-capture middleware.

The middleware is exercised directly with a mock request (no running Django server), against a throwaway project database.

class autowisp.tests.test_error_capture_middleware.TestErrorCaptureMiddleware(methodName='runTest')[source]

Bases: TestCase

Inheritance diagram of autowisp.tests.test_error_capture_middleware.TestErrorCaptureMiddleware

process_exception records the error with a keys-only request snapshot.

setUp()[source]

Hook method for setting up the test fixture before exercising it.

classmethod setUpClass()[source]

Hook method for setting up class fixture before running tests in the class.

classmethod tearDownClass()[source]

Hook method for deconstructing the class fixture after running all tests in the class.

test_recording_failure_is_swallowed()[source]

A failure while recording does not propagate from the hook.

test_request_snapshot_keys_only()[source]

The snapshot captures parameter keys, never their values.

test_unknown_exception_wrapped_and_recorded()[source]

A bare view exception is recorded as a BUI ViewError.

autowisp.tests.test_error_capture_middleware._mock_request()[source]

A stand-in Django request exposing the attributes we snapshot.