The `get_or_add_addon` method of the `AuthUserFactory` in the `tests.factories` module is used to either retrieve an existing addon or create a new one for the authenticated user. This method ensures that each user has a unique addon associated with their account. If an addon already exists for the user, it is returned. Otherwise, a new addon is created and linked to the user's account. This is useful for testing scenarios where a user needs to have a specific addon for a particular functionality.
Python AuthUserFactory.get_or_add_addon - 23 examples found. These are the top rated real world Python examples of tests.factories.AuthUserFactory.get_or_add_addon extracted from open source projects. You can rate examples to help us improve the quality of examples.