onadata.apps.api.tests.viewsets package

Submodules

onadata.apps.api.tests.viewsets.test_abstract_viewset module

onadata.apps.api.tests.viewsets.test_attachment_viewset module

onadata.apps.api.tests.viewsets.test_briefcase_viewset module

onadata.apps.api.tests.viewsets.test_charts_viewset module

Test ChartsViewSet.

class onadata.apps.api.tests.viewsets.test_charts_viewset.TestChartsViewSet(methodName='runTest')

Bases: TestBase

setUp()

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

test_cascading_select()
test_chart_list()
test_chart_list_with_xform_in_delete_async()
test_charts_caching()

Test that the chart endpoints caching works as expected

test_charts_group_by_select_one()

Test that the chart endpoint works correctly when grouping with select one field

test_correct_merged_dataset_data_for_charts()

Return correct data from the charts endpoint

test_deleted_submission_not_in_chart_endpoint()
test_duration_field_on_metadata()
test_get_all_fields()
test_get_invalid_field_name()
test_get_on_categorized_field()
test_get_on_date_field()
test_get_on_date_field_with_invalid_data(mock_execute_query)
test_get_on_numeric_field()
test_get_on_select_field()
test_get_on_select_field_xpath()
test_get_on_select_multi_field()
test_get_on_select_multi_field_html_format()
test_get_specific_fields()
test_nan_not_json_response()
test_on_charts_with_content_type()
onadata.apps.api.tests.viewsets.test_charts_viewset.raise_data_error(a)

onadata.apps.api.tests.viewsets.test_connect_viewset module

onadata.apps.api.tests.viewsets.test_data_viewset module

onadata.apps.api.tests.viewsets.test_dataview_viewset module

onadata.apps.api.tests.viewsets.test_entity_list_viewset module

onadata.apps.api.tests.viewsets.test_export_viewset module

onadata.apps.api.tests.viewsets.test_floip_viewset module

onadata.apps.api.tests.viewsets.test_legacy_exports module

class onadata.apps.api.tests.viewsets.test_legacy_exports.TestLegacyExports(methodName='runTest')

Bases: TestBase

setUp()

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

test_data_export()
test_form_data_export()

onadata.apps.api.tests.viewsets.test_media_viewset module

onadata.apps.api.tests.viewsets.test_merged_xform_viewset module

onadata.apps.api.tests.viewsets.test_messaging_stats_viewset module

Module containing test for the MessagingStatsViewset (api/v1/stats/messaging)

class onadata.apps.api.tests.viewsets.test_messaging_stats_viewset.TestMessagingStatsViewSet(methodName='runTest')

Bases: TestBase

Test /api/v1/stats/messaging endpoint

setUp()

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

test_expected_responses()

Test to ensure that the expected responses are returned

test_filters()

Test to ensure that the verb and timestamp filters work as expected

test_required_fields()

Test that errors are raised when required fields are not passed

onadata.apps.api.tests.viewsets.test_metadata_viewset module

onadata.apps.api.tests.viewsets.test_note_viewset module

class onadata.apps.api.tests.viewsets.test_note_viewset.TestNoteViewSet(methodName='runTest')

Bases: TestBase

Test NoteViewSet

setUp()

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

test_add_notes_to_data_point()
test_attribute_error_bug()

NoteSerializer: Should not raise AttributeError exeption

test_collaborator_with_readonly_permission_can_add_comment()
test_delete_note()
test_get_note_for_specific_instance()
test_note_get()
test_note_list()
test_only_add_question_notes_to_existing_fields()
test_other_user_notes_access()
test_question_level_notes()

onadata.apps.api.tests.viewsets.test_ona_api module

onadata.apps.api.tests.viewsets.test_open_data_viewset module

OpenData tests.

class onadata.apps.api.tests.viewsets.test_open_data_viewset.TestOpenData(methodName='runTest')

Bases: TestBase

Test tableau unpacks repeat data successfully

setUp()

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

test_tableau_data_fetch()

Test that the row headers generated match the column headers for the same form

test_tableau_get_nested_repeat_group_data()

Test that data received from nested repeat groups is flattened and the tablau data endpoint returns accurate data for this question type

test_tableau_get_repeat_data()

Test that data received from repeats is flattened and the tablau data endpoint returns accurate data for this question type

class onadata.apps.api.tests.viewsets.test_open_data_viewset.TestOpenDataViewSet(methodName='runTest')

Bases: TestBase

get_open_data_object()
setUp()

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

test_column_headers_endpoint()
test_create_open_data_object_with_invalid_fields()
test_create_open_data_object_with_valid_fields()
test_delete_open_data_object()
test_get_data_using_uuid()
test_get_data_using_uuid_and_greater_than_query_param()
test_get_data_with_pagination()
test_replace_special_characters_with_underscores()
test_response_if_open_data_object_is_inactive()
test_unpack_tableau_data_successfully()

Test group data as well as select multiple data are unpacked successfully

test_update_open_data_with_valid_fields_and_data()
test_uuid_endpoint()
onadata.apps.api.tests.viewsets.test_open_data_viewset.streaming_data(response)

onadata.apps.api.tests.viewsets.test_organization_profile_viewset module

onadata.apps.api.tests.viewsets.test_osm_viewset module

onadata.apps.api.tests.viewsets.test_project_viewset module

onadata.apps.api.tests.viewsets.test_stats_viewset module

class onadata.apps.api.tests.viewsets.test_stats_viewset.TestStatsViewSet(methodName='runTest')

Bases: TestBase

setUp()

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

test_all_stats_api()
test_anon_form_list()
test_bad_field()
test_form_list_select_one_choices()
test_form_list_select_one_choices_multi_language()
test_mean_api()
test_median_api()
test_mode_api()
test_range_api()
test_submissions_stats()
test_submissions_stats_with_xform_in_delete_async_queue()
test_wrong_stat_function_api()

onadata.apps.api.tests.viewsets.test_submission_review_viewset module

Submission Review ViewSet Tests Module

class onadata.apps.api.tests.viewsets.test_submission_review_viewset.TestSubmissionReviewViewSet(methodName='runTest')

Bases: TestBase

Test SubmissionReviewViewset Class

setUp()

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

test_bulk_create_approved_review_missiong_note()

Test that we can bulk create approved submission reviews without a note

test_bulk_create_submission_review(mock_send_message)

Test that we can bulk create submission reviews

test_bulk_create_submission_review_permissions()

Test that bulk create fails when the user has no permission to any submission

test_delete_submission_review()
Test:
  • Soft-Deletes Submission Review

  • Deleted Submission Reviews Do not show up on on list

test_retrieve_submission_review()

Test we can retrieve a submission review

test_submission_review_create(mock_send_message)

Test we can create a submission review

test_submission_review_created_by_filter()

Test we can filter by created_by

test_submission_review_instance_filter()

Test can filter Submission Reviews By Instance

test_submission_review_list()

Test we can list submission reviews

test_submission_review_permission()

Test that submission review access to unauthorized users

test_submission_review_status_filter()

Test can filter Submission Reviews By Status

test_submission_review_update()

Test that we can update submission_reviews

onadata.apps.api.tests.viewsets.test_tableau_viewset module

OpenData tests.

class onadata.apps.api.tests.viewsets.test_tableau_viewset.TestTableauViewSet(methodName='runTest')

Bases: TestBase

get_open_data_object()
setUp()

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

test_clean_xform_headers()

Test that column header fields for group columns do not contain indexing when schema columns are being pushed to Tableau.

test_count_query_param()

count query param works

test_gt_id_query_param()

gt_id query param works

test_pagination()

Pagination works correctly

Test that attachment details exported to Tableau contains media file download links instead of the file name.

test_tableau_data_and_fetch()

Test the schema and data endpoint and data returned by each.

test_unpack_gps_data()

Test that gps data is unpacked into 4 separate columns specific to latitude, longitude, alitude and precision.

test_unpack_select_multiple_data()

Test expected output when unpack_select_multiple_data function is run.

onadata.apps.api.tests.viewsets.test_tableau_viewset.streaming_data(response)

onadata.apps.api.tests.viewsets.test_team_viewset module

onadata.apps.api.tests.viewsets.test_user_profile_viewset module

onadata.apps.api.tests.viewsets.test_user_viewset module

onadata.apps.api.tests.viewsets.test_widget_viewset module

onadata.apps.api.tests.viewsets.test_xform_list_viewset module

onadata.apps.api.tests.viewsets.test_xform_submission_viewset module

onadata.apps.api.tests.viewsets.test_xform_viewset module

Module contents