onadata.apps.viewer.tests package

Submodules

onadata.apps.viewer.tests.export_helpers module

onadata.apps.viewer.tests.export_helpers.viewer_fixture_path(*args)

onadata.apps.viewer.tests.surveyor_registration module

onadata.apps.viewer.tests.test_attachment_url module

class onadata.apps.viewer.tests.test_attachment_url.TestAttachmentUrl(methodName='runTest')

Bases: onadata.apps.main.tests.test_base.TestBase

setUp()

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

tearDown()

Hook method for deconstructing the test fixture after testing it.

test_attachment_has_mimetype()
test_attachment_not_found()
test_attachment_url()
test_attachment_url_no_redirect()

onadata.apps.viewer.tests.test_charts_view module

class onadata.apps.viewer.tests.test_charts_view.TestChartsView(methodName='runTest')

Bases: onadata.apps.main.tests.test_base.TestBase

setUp()

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

test_chart_view_with_bad_lang_param()
test_chart_view_with_lang_param()
test_charts_view_returns_200()

onadata.apps.viewer.tests.test_data_view module

class onadata.apps.viewer.tests.test_data_view.TestDataView(methodName='runTest')

Bases: onadata.apps.main.tests.test_base.TestBase

setUp()

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

test_allow_if_shared()
test_allow_if_user_given_permission()
test_data_view()
test_data_view_with_username_and_id_string_in_uppercase()
test_disallow_if_user_permission_revoked()
test_restrict_for_anon()
test_restrict_for_not_owner()

onadata.apps.viewer.tests.test_export_builder module

onadata.apps.viewer.tests.test_export_list module

class onadata.apps.viewer.tests.test_export_list.TestDataExportURL(methodName='runTest')

Bases: onadata.apps.main.tests.test_base.TestBase

setUp()

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

test_csv_export_url()
test_csv_export_url_without_records()
test_csv_zip_export_url()
test_sav_zip_export_long_variable_length()
test_sav_zip_export_url()
test_xls_export_url()
class onadata.apps.viewer.tests.test_export_list.TestExportList(methodName='runTest')

Bases: onadata.apps.main.tests.test_base.TestBase

setUp()

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

test_csv_export_list()
test_csv_zip_export_list()
test_export_data_with_unavailable_id_string()
test_external_export_list()
test_external_export_list_no_template()
test_kml_export_list()
test_sav_zip_export_list()
test_unauthorised_users_cannot_export_form_data()
test_unsupported_type_export()
test_xls_export_list()
test_zip_export_list()

onadata.apps.viewer.tests.test_exports module

class onadata.apps.viewer.tests.test_exports.TestExports(methodName='runTest')

Bases: onadata.apps.main.tests.test_base.TestBase

class FakeDate

Bases: datetime.datetime

classmethod now(tz=None)

Returns new datetime object representing current time local to tz.

tz
Timezone object.

If no tz is specified, uses local timezone.

setUp()

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

test_404_on_export_io_error()

Test that we return a 404 when the response_with_mimetype_and_name encounters an IOError

test_add_index_to_filename()
test_all_keys_cleaned_of_slashes()
test_auto_export_if_none_exists()
test_column_header_delimiter_export_option()
test_create_export()
test_create_export_url()
test_create_export_url_with_unavailable_id_string()
test_create_external_export_url()
test_create_external_export_url_with_non_existing_export_id(mock_404)
test_create_external_export_without_template()
test_create_xls_export_non_existent_id()
test_csv_http_response()
test_csv_without_na_values()
test_delete_export_url()
test_delete_file_on_export_delete()
test_delete_oldest_export_on_limit()
test_deleted_submission_not_in_export()
test_dict_to_joined_export_notes()
test_dict_to_joined_export_works()
test_direct_export_returns_newest_export_if_not_updated_since()
test_dont_auto_export_if_exports_exist()
test_duplicate_export_filename_is_renamed()
test_edited_submissions_in_exports()
test_export_download_url()
test_export_ids_dont_have_comma_separation()

It seems using {{ }} to output numbers greater than 1000 formats the number with a thousand separator

test_export_progress_output()
test_export_progress_updates()

Test that after generate_export is called, we change out state to pending and after its complete, we change it to complete, if we fail between the two, updates, we have failed

test_exports_outdated_considers_pending_exports()
test_exports_outdated_doesnt_consider_failed_exports()
test_generate_csv_zip_export()
test_graceful_exit_on_export_delete_if_file_doesnt_exist()
test_invalid_export_type()
test_last_submission_time_empty()
test_last_submission_time_on_export()
test_query_data_with_invalid_args()
test_responses_for_empty_exports()
test_split_select_multiple_export_option()
test_unique_xls_sheet_name()

onadata.apps.viewer.tests.test_instance_view module

class onadata.apps.viewer.tests.test_instance_view.TestInstanceView(methodName='runTest')

Bases: onadata.apps.main.tests.test_base.TestBase

setUp()

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

test_allow_if_shared()
test_allow_if_user_given_permission()
test_disallow_if_user_permission_revoked()
test_instance_view()
test_restrict_for_anon()
test_restrict_for_not_owner()

onadata.apps.viewer.tests.test_kml_export module

class onadata.apps.viewer.tests.test_kml_export.TestKMLExport(methodName='runTest')

Bases: onadata.apps.main.tests.test_base.TestBase

test_kml_export()

onadata.apps.viewer.tests.test_map_view module

class onadata.apps.viewer.tests.test_map_view.TestMapView(methodName='runTest')

Bases: django.test.testcases.TestCase

test_jsonform_url()

onadata.apps.viewer.tests.test_parsed_instance module

class onadata.apps.viewer.tests.test_parsed_instance.TestParsedInstance(methodName='runTest')

Bases: onadata.apps.main.tests.test_base.TestBase

test_get_where_clause_with_integer()
test_get_where_clause_with_json_query()
test_get_where_clause_with_string_query()
test_retrieve_records_based_on_form_verion()

onadata.apps.viewer.tests.test_stats_table_view module

class onadata.apps.viewer.tests.test_stats_table_view.TestStatsTableView(methodName='runTest')

Bases: onadata.apps.main.tests.test_base.TestBase

setUp()

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

test_view_returns_200()

onadata.apps.viewer.tests.test_tasks module

class onadata.apps.viewer.tests.test_tasks.TestExportTasks(methodName='runTest')

Bases: onadata.apps.main.tests.test_base.TestBase

setUp()

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

test_create_async()
test_delete_expired_failed_exports()
test_mark_expired_pending_exports_as_failed()

onadata.apps.viewer.tests.test_viewer_tools module

Module contents