Fix tests/methods that refer to private functions in Python
See original GitHub issueThere are currently a few tests that reference private functions in Python. Tests should test through public interface. If the test tests a private method, find a way to test the method through the existing public interface instead (you’ll need to find the corresponding public API function that uses the internal private one, and use that function instead in tests). Please note that modifications to other classes outside of the file in question may be necessary.
Note that you can identify such references by searching for the string # pylint: disable=protected-access
. (If you don’t see the string in the file(s) you’re assigned to, please let the author of this issue know so that the list can be edited accordingly.)
Important: In general, do not just change methods from private to public. You’ll need to find the already existing publicly-accessible function which invokes the private method and use that one instead.
The following the cases where we test private functions:
- gae_models.VersionedModel @Azrecycle4
- delete
- revert
- get_version
- get_multi_versions
- get_snapshots_metadata
- suggestion_services_test.SuggestionServicesUnitTests @gopivaibhav
- test_accept_suggestion_commit_message_after_updating_a_suggestion
- test_update_translation_suggestion_to_change_translation_html
- suggestion_services_test.SuggestionIntegrationTests @hardikkat24
- setUp
- email_manager_test.EmailRightsTest @vijaykpatel
- test_sender_id_validation
- email_manager.BulkEmailsTests @brianlinUM
- test_that_correct_email_is_sent
- test_that_exception_is_raised_for_unauthorised_sender
- library_test.LibraryPageTests @brianlinUM
- test_library_handler_for_created_explorations
- build_test (All) @Mohitbalwani26
- suggestion_test.SuggestionUnitTests @AnuragVats007
- setUp
- exp_services_test.ZipFileExportUnitTests (all) @ayushjaink8
Completed:
- draft_upgrade_services_test.DraftUpgradeUnitTests @kaylahardie
- test_try_upgrade_success
- draft_upgrade_services_test.DraftUpgradeUtilUnitTests @kaylahardie
- test_convert_states_v29_dict_to_v30_dict
- test_convert_states_v28_dict_to_v29_dict
- test_convert_states_v27_dict_to_v28_dict
- gae_models_test.GenerateHashTests - @lorryaze
- test_same_inputs_always_gives_same_hashes
- test_different_inputs_give_different_hashes
- models_test.BaseCalculationUnitTests @donosco98 (#7841)
- test_equality_of_hashable_answers
- user_services_test.LastLoginIntegrationTests @vpishuk
- test_legacy_user
- user_services_test.LastExplorationEditedIntegrationTests @vpishuk
- test_legacy_user
- test_last_exp_edit_time_gets_updated
- user_services_test.LastExplorationCreatedIntegrationTests @vpishuk
- test_legacy_user
- test_last_exp_edit_time_gets_updated
- config_domain_test.ConfigPropertyRegistryTests (@nishantwrp)
- test_config_property_schemas_are_valid
- email_manager.DuplicateEmailTests @Hudda
- test_send_email_does_not_resend_if_same_hash_exists
- test_sending_email_with_different_recipient_but_same_hash
- test_sending_email_with_different_subject_but_same_hash
- test_sending_email_with_different_body_but_same_hash
- test_duplicate_emails_are_sent_after_some_time_has_elapsed
- user_jobs_one_off_test.UserFirstContributionMsecOneOffJobTests - @Arnesh07
- test_contribution_msec_does_not_update_on_unpublished_explorations
- user_jobs_one_off_test.UserLastExplorationActivityOneOffJobTests @Hudda
- test_that_last_created_time_is_updated
- html_validation_service_test.ContentMigrationTests - @cathuang20
- test_validate_soup_for_rte
- test_validate_customization_args_in_tag
- test_that_last_edited_time_is_updated
- test_that_last_edited_and_created_time_both_updated
- test_that_last_edited_and_created_time_are_not_updated
- rte_component_registry_test.RteComponentUnitTests - @alexlee311
- test_rte_components_are_valid
- extensions.interactions.base_test.InteractionUnitTests - @aazuspan
- test_default_interactions_are_valid
- collection_services_test @sudiptapradhan1181
- _count_at_least_editable_collection_summaries
- exp_services.test - @aazuspan
- _count_at_least_editable_exploration_summaries
Issue Analytics
- State:
- Created 4 years ago
- Comments:145 (124 by maintainers)
Top GitHub Comments
@vojtechjelinek Can you unassign me from SuggestionServicesUnitTests? Thank you.
@kevinlee12 Thanks a lot for the update and for letting us know we can reach out to you when needed 😃