onadata.libs.tests package

Subpackages

Submodules

onadata.libs.tests.test_authentication module

class onadata.libs.tests.test_authentication.TestGetAPIToken(methodName='runTest')

Bases: TestCase

test_bad_signature()
test_non_existent_token()
class onadata.libs.tests.test_authentication.TestLockout(methodName='runTest')

Bases: TestCase

Test user lockout functions.

setUp()

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

test_check_lockout()

Test check_lockout() function.

test_exception_on_username_with_whitespaces()

Test the check_lockout properly handles usernames with trailing whitespaces

class onadata.libs.tests.test_authentication.TestMasterReplicaOAuth2Validator(methodName='runTest')

Bases: TestCase

test_reads_from_master(mock_token_class)
class onadata.libs.tests.test_authentication.TestPermissions(methodName='runTest')

Bases: TestCase

setUp()

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

test_invalid_bytes_in_digest()
class onadata.libs.tests.test_authentication.TestTempTokenAuthentication(methodName='runTest')

Bases: TestCase

setUp()

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

test_authenticates_if_token_is_valid()
test_expired_temp_token()
test_inactive_user()
test_invalid_temp_token()
class onadata.libs.tests.test_authentication.TestTempTokenURLParameterAuthentication(methodName='runTest')

Bases: TestCase

setUp()

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

test_returns_false_if_no_param()

onadata.libs.tests.test_pagination module

Tests onadata.libs.pagination module

class onadata.libs.tests.test_pagination.RawSQLQueryPageNumberPaginationTestCase(methodName='runTest')

Bases: TestBase

Tests for the RawSQLQueryPageNumberPagination class

setUp()

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

test_offset_limit()

Returns the correct values for offset and limit

class onadata.libs.tests.test_pagination.TestPaginationModule(methodName='runTest')

Bases: TestBase

Tests for onadata.libs.pagination module

onadata.libs.tests.test_permissions module

Tests onadata.libs.permissions module

class onadata.libs.tests.test_permissions.TestPermissions(methodName='runTest')

Bases: TestBase

Tests for onadata.libs.permissions module

test_exception_raised_for_missing_profiles()

Test UserProfile.DoesNotExit exception raised for missing user profiles

test_filter_queryset_xform_meta_perms_sql(check_meta_mock)

Test filter query by meta permissions.

test_get_object_users_with_permission()

Test get_object_users_with_permissions()

test_manager_has_role()

Test manager has role

test_manager_role_add()

Test adding ManagerRole

test_readonly_no_downloads_has_role()

Test readonly no downloads role.

test_reassign_role()

Test role reassignment.

test_reassign_role_owner_to_editor()

Test role reassignment owner to editor.

test_user_profile_exists_for_users_with_perms()

Test user profile exists when retrieving users with perms

onadata.libs.tests.test_permissions.perms_for(user, obj)

Return user permissions for obj.

onadata.libs.tests.test_renderers module

Test Renderer module.

class onadata.libs.tests.test_renderers.TestRenderers(methodName='runTest')

Bases: TestCase

Test Renderer class.

test_floip_rows_list()

Test floip_rows_list() function.

test_floip_rows_list_w_flow_fields()

Test floip_rows_list() function with sessionID and contactID

onadata.libs.tests.test_throttle module

class onadata.libs.tests.test_throttle.CustomScopedRateThrottleTest(methodName='runTest')

Bases: TestCase

setUp()

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

test_anonymous_users()

Anonymous users get throttled base on URI path

test_authenticated_users()

Authenticated users get throttled base on user id

class onadata.libs.tests.test_throttle.ThrottlingTests(methodName='runTest')

Bases: TestCase

setUp()

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

test_request_throttling_multiple_headers()
test_requests_are_throttled()

Module contents