Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Optional TOS feature with /environment flag #4726

Merged
merged 6 commits into from Nov 16, 2023

Conversation

RuthShryock
Copy link
Member

Checklist

  1. If you've added code that should be tested, add tests
  2. If you've changed APIs, update (or create!) the documentation
  3. Ensure the tests pass
  4. Make sure that your code lints and that you've followed our coding style
  5. Write a title and, if necessary, a description of your work suitable for publishing in our release notes
  6. Mention any related issues in this repository (as #ISSUE) and in other repositories (as kobotoolbox/other#ISSUE)
  7. Open an issue in the docs if there are UI/UX changes

Notes

Added terms_of_service__sitewidemessage__exists flag to the /environment endpoint so that the frontend can display the TOS feature depending on the server.

Copy link

@@ -116,6 +117,7 @@ def setUp(self):
'custom_password_localized_help_text': markdown(
I18nUtils.get_custom_password_help_text()
),
'terms_of_service__sitewidemessage__exists' : SitewideMessage.objects.filter(slug='terms_of_service').exists(),
Copy link
Contributor

@p2edwards p2edwards Nov 13, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This appears to match the implementation logic — and so it wouldn't exactly test the logic itself (or catch a regression)

Could we set up a couple of simple/exact test assertions to cover each possibility?

  • (1) set a sitewide message called terms_of_service to a static value, assert env's terms_of_service__sitewidemessage__exists reads true
  • (2) remove or don't set a sitewide message called terms_of_service, assert env's terms_of_service__sitewidemessage__exists reads false

@p2edwards p2edwards merged commit a462427 into feature/tos Nov 16, 2023
4 checks passed
@p2edwards p2edwards deleted the tos-flag-environment-endpoint branch November 16, 2023 20:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants