Location: Pulp SmashAPI Documentationpulp_smash.tests.pulp2.platform.api_v2.test_user

Test the user API endpoints.

The assumptions explored in this module have the following dependencies:

It is possible to create a user.
├── It is impossible to create a duplicate user.
├── It is possible to read a user.
├── It is possible to update a user.
│   └── It is possible to search for a (updated) user.
└── It is possible to delete a user.
class pulp_smash.tests.pulp2.platform.api_v2.test_user.CreateTestCase(*args, **kwargs)

Establish that we can create users. No prior assumptions are made.

classmethod setUpClass()

Create several users.

Create one user with the minimum required attributes, and another with all available attributes.


Assert that each user has the requested attributes.


Assert that responses do not contain passwords.


Assert that each response has an HTTP 201 status code.

class pulp_smash.tests.pulp2.platform.api_v2.test_user.ReadUpdateDeleteTestCase(*args, **kwargs)

Establish that we can read, update and delete users.

This test case assumes that the assertions in CreateTestCase are valid.

classmethod setUpClass()

Create three users and read, update and delete them respectively.


Verify one cannot create a user with a duplicate login.


Ensure read and update responses do not contain a password.

Target https://bugzilla.redhat.com/show_bug.cgi?id=1020300.


Ensure read, update and delete responses have 200 status codes.


Assert the updated user has the assigned attributes.


Assert one can log in with a user with an updated password.


Assert one cannot read, update or delete a deleted user.

class pulp_smash.tests.pulp2.platform.api_v2.test_user.SearchTestCase(*args, **kwargs)

Establish we can search for users.

This test case assumes the assertions in ReadUpdateDeleteTestCase are valid.

classmethod setUpClass()

Create a user and add it to the ‘super-users’ role.

Search for:

  • Nothing at all:
  • All users having only the super-users role.
  • All users having no roles.
  • A user by their login.
  • A non-existent user by their login.

Assert the global search includes our user.


Search for a non-existent user via the “login” filter.


Search for a user via the “login” filter.


Assert that the “roles” filter can be used for exclusion.


Assert that the “roles” filter can be used for inclusion.


Assert each response has an HTTP 200 status code.