onadata.apps.main.tests package¶
Submodules¶
onadata.apps.main.tests.test_audit_log module¶
onadata.apps.main.tests.test_base module¶
TestBase - a TestCase base class.
- class onadata.apps.main.tests.test_base.TestBase(methodName='runTest')¶
Bases:
PyxformMarkdown
,TransactionTestCase
A TransactionTestCase base class for test modules.
- maxDiff = None¶
- setUp()¶
Hook method for setting up the test fixture before exercising it.
- surveys = ['transport_2011-07-25_19-05-49', 'transport_2011-07-25_19-05-36', 'transport_2011-07-25_19-06-01', 'transport_2011-07-25_19-06-14']¶
- this_directory = '/home/onadata/app-versioned/1712856376/onadata/apps/main/tests'¶
onadata.apps.main.tests.test_csv_export module¶
Test CSV Exports
- class onadata.apps.main.tests.test_csv_export.TestCsvExport(methodName='runTest')¶
Bases:
TestBase
TestCSVExport class
- setUp()¶
Hook method for setting up the test fixture before exercising it.
- test_csv_export_output()¶
Test CSV export output
- test_csv_nested_repeat_output()¶
Test CSV export with nested repeats
- test_csv_repeat_with_note()¶
Test that note field in repeat is not in csv export
- test_csv_truncated_titles()¶
Test CSV export with removed_group_name = True
- test_dotted_fields_csv_export()¶
Test CSV export with dotted field names
onadata.apps.main.tests.test_custom_context_processors module¶
onadata.apps.main.tests.test_form_api module¶
Test onadata.apps.main.views.api.
- class onadata.apps.main.tests.test_form_api.TestFormAPI(methodName='runTest')¶
Bases:
TestBase
Test the form API endpoint.
- setUp()¶
Hook method for setting up the test fixture before exercising it.
- test_api()¶
Test the forms /api endpoint.
- test_api_column_select()¶
Test fields parameter at the API endpoint.
- test_api_cors_options()¶
Test CORS options at the API endpoint.
- test_api_count()¶
Test count parameter at the form API endpoint.
- test_api_decode_from_mongo()¶
Test API decodes Mongo DB symbols.
- test_api_jsonp()¶
Test support for jsonp response at the API endpoint.
- test_api_query_no_records()¶
Test query param that returns no records.
- test_api_with_or_query()¶
Test that an or query is interpreted correctly since we use an internal or query to filter out deleted records
- test_api_with_query()¶
Test the query param for forms API endpoint.
- test_api_with_query_invalid_start_limit()¶
Test start and limit query parameters with invalid values.
- test_api_with_query_start_limit()¶
Test start and limit query parameters.
- test_handle_bad_json()¶
Test a bad query is handled correctly with status 400.
onadata.apps.main.tests.test_form_api_delete module¶
onadata.apps.main.tests.test_form_auth module¶
onadata.apps.main.tests.test_form_edit module¶
- class onadata.apps.main.tests.test_form_edit.TestFormEdit(methodName='runTest')¶
Bases:
TestBase
- setUp()¶
Hook method for setting up the test fixture before exercising it.
- test_anon_no_edit_post()¶
- test_delete_404()¶
- test_not_owner_no_edit_post()¶
- test_user_data_license_edit_updates()¶
- test_user_description_edit_updates()¶
- test_user_form_license_edit_updates()¶
- test_user_title_edit_updates()¶
- test_user_toggle_data_privacy()¶
- test_user_toggle_data_privacy_off()¶
- test_user_toggle_form_downloadable()¶
- test_user_toggle_form_downloadable_off()¶
- test_user_toggle_form_privacy()¶
- test_user_toggle_form_privacy_off()¶
onadata.apps.main.tests.test_form_enter_data module¶
onadata.apps.main.tests.test_form_errors module¶
- class onadata.apps.main.tests.test_form_errors.TestFormErrors(methodName='runTest')¶
Bases:
TestBase
- test_bad_id_string()¶
- test_choice_duplicate_error()¶
Test that the choice duplicate error is raised if the “allow_choice_duplicates” setting is not set in the forms settings sheet
- test_dl_no_xls()¶
Exports are built from the JSON form structure so we dont need the xls to generate an export
- test_dl_xls_not_file()¶
- test_empty_submission()¶
- test_nonexist_id_string()¶
- test_spaced_xlsform()¶
- test_submission_deactivated()¶
onadata.apps.main.tests.test_form_exports module¶
- class onadata.apps.main.tests.test_form_exports.TestFormExports(methodName='runTest')¶
Bases:
TestBase
- setUp()¶
Hook method for setting up the test fixture before exercising it.
- test_allow_csv_export()¶
- test_allow_csv_export_for_basic_auth()¶
- test_allow_export_download_for_basic_auth()¶
- test_allow_kml_export()¶
- test_allow_kml_export_for_basic_auth()¶
- test_allow_xlsx_export()¶
- test_allow_xlsx_export_for_basic_auth()¶
- test_allow_zip_export()¶
- test_allow_zip_export_for_basic_auth()¶
- test_csv_raw_export_name()¶
- test_filter_by_date_csv()¶
- test_filter_by_date_xls()¶
- test_xls_raw_export_name()¶
- test_zip_raw_export_name()¶
onadata.apps.main.tests.test_form_gallery module¶
- class onadata.apps.main.tests.test_form_gallery.TestFormGallery(methodName='runTest')¶
Bases:
TestBase
- setUp()¶
Hook method for setting up the test fixture before exercising it.
- test_clone_for_other_user()¶
- test_clone_id_string_starts_with_number()¶
- test_clone_with_username_and_id_string_in_uppercase()¶
- test_require_logged_in_user()¶
onadata.apps.main.tests.test_form_metadata module¶
Test form MetaData objects.
- class onadata.apps.main.tests.test_form_metadata.TestFormMetadata(methodName='runTest')¶
Bases:
TestBase
Test form MetaData objects.
- setUp()¶
Hook method for setting up the test fixture before exercising it.
- test_add_media_url()¶
- test_adds_mapbox_layer_on_submit()¶
- test_adds_supporting_doc_on_submit()¶
- test_adds_supporting_media_on_submit()¶
- test_anon_delete_mapbox_layer()¶
- test_delete_cached_xform_metadata_object_on_save()¶
- test_delete_mapbox_layer()¶
- test_delete_supporting_doc()¶
- test_delete_supporting_media()¶
- test_download_supporting_doc()¶
- test_download_supporting_media()¶
- test_media_file_hash()¶
- test_no_download_supporting_doc_for_anon()¶
- test_shows_mapbox_layer_after_submit()¶
- test_shows_supporting_doc_after_submit()¶
- test_shows_supporting_media_after_submit()¶
- test_upload_source_file()¶
- test_upload_source_file_keep_name()¶
- test_upload_source_file_set_value_to_name()¶
- test_user_source_edit_updates()¶
- test_windows_csv_file_upload()¶
onadata.apps.main.tests.test_form_permissions module¶
- class onadata.apps.main.tests.test_form_permissions.TestFormPermissions(methodName='runTest')¶
Bases:
TestBase
- setUp()¶
Hook method for setting up the test fixture before exercising it.
- test_add_edit_to_user()¶
- test_add_view_permisions_to_user()¶
- test_add_view_to_user()¶
- test_allow_map()¶
- test_allow_map_if_user_given_permission()¶
- test_anon_reject_api()¶
- test_client_allow_api()¶
- test_disallow_map_if_user_permission_revoked()¶
- test_remove_permissions_from_user()¶
- test_require_owner_to_add_perm()¶
- test_restrict_map_for_anon()¶
- test_restrict_map_for_not_owner()¶
- test_set_permissions_for_user()¶
onadata.apps.main.tests.test_form_public_api module¶
onadata.apps.main.tests.test_form_show module¶
onadata.apps.main.tests.test_gps module¶
onadata.apps.main.tests.test_http_auth module¶
Test basic authentication
onadata.apps.main.tests.test_metadata module¶
Test MetaData model.
- class onadata.apps.main.tests.test_metadata.TestMetaData(methodName='runTest')¶
Bases:
TestBase
Test MetaData model.
- setUp()¶
Hook method for setting up the test fixture before exercising it.
- test_create_google_sheet_metadata_object()¶
- test_create_metadata()¶
- test_saving_same_metadata_object_doesnt_trigger_integrity_error()¶
- test_unique_type_for_form()¶
- test_upload_to_with_anonymous_user()¶
- test_upload_to_with_project_and_xform_instance()¶
onadata.apps.main.tests.test_past_bugs module¶
- class onadata.apps.main.tests.test_past_bugs.TestCascading(methodName='runTest')¶
Bases:
TestBase
- test_correct_id_string_picked()¶
- class onadata.apps.main.tests.test_past_bugs.TestInputs(methodName='runTest')¶
Bases:
TestBase
This is where I’ll input all files that proved problematic for users when uploading.
- test_erics_files()¶
- test_mch()¶
- test_uniqueness_of_group_names_enforced()¶
Test an error is raised when a form containing a group with the name “data” is present within the form.
This error is raised due to the fact that the root node is named “data”
onadata.apps.main.tests.test_process module¶
onadata.apps.main.tests.test_style module¶
onadata.apps.main.tests.test_user_id_string_unique_together module¶
onadata.apps.main.tests.test_user_login module¶
onadata.apps.main.tests.test_user_profile module¶
onadata.apps.main.tests.test_user_settings module¶
- class onadata.apps.main.tests.test_user_settings.TestUserSettings(methodName='runTest')¶
Bases:
TestBase
- setUp()¶
Hook method for setting up the test fixture before exercising it.
- test_access_user_settings_non_owner()¶
- test_render_user_settings()¶
- test_show_existing_profile_data()¶
- test_update_user_settings()¶