Jump to >

This documentation covers Djblets 2.0. You can see the latest Djblets documentation or all other versions.

djblets.testing.decorators

add_fixtures(fixtures, replace=False)[source]

Adds or replaces the fixtures used for this test.

This must be used along with djblets.testing.testcases.TestCase().

requires_user_profile(f)[source]

Ensure that User.get_profile exists for the following unit test.

In Django 1.7+, User.get_profile no longer exists. Currently some parts of Djblets require this method to exist in Django or be added by the consuming app. To fix this requirement for unit testing on Django 1.7+, we attach a method that raises NotImplementedError when the method does not exist. After the test exits the method will be removed.

Parameters:f (callable or type) – The function or class to decorate
Returns:The decorated function or class.
Return type:callable or type