Merge pull request #17688 from edx/robrap/update-waffle-docs

Add docs for handling default values.
This commit is contained in:
Robert Raposa
2018-03-15 17:26:02 -04:00
committed by GitHub
3 changed files with 18 additions and 34 deletions

View File

@@ -397,35 +397,6 @@ class ProctoredExamsTest(BaseInstructorDashboardTest):
self.courseware_page.stop_timed_exam()
LogoutPage(self.browser).visit()
def test_can_add_remove_allowance(self):
"""
Make sure that allowances can be added and removed.
"""
# Given that an exam has been configured to be a timed exam.
self._create_a_timed_exam_and_attempt()
# When I log in as an instructor,
__, __ = self.log_in_as_instructor()
# And visit the Allowance Section of Instructor Dashboard's Special Exams tab
instructor_dashboard_page = self.visit_instructor_dashboard()
allowance_section = instructor_dashboard_page.select_special_exams().select_allowance_section()
# Then I can add Allowance to that exam for a student
self.assertTrue(allowance_section.is_add_allowance_button_visible)
# When I click the Add Allowance button
allowance_section.click_add_allowance_button()
# Then popup should be visible
self.assertTrue(allowance_section.is_add_allowance_popup_visible)
# When I fill and submit the allowance form
allowance_section.submit_allowance_form('10', self.USERNAME)
# Then, the added record should be visible
self.assertTrue(allowance_section.is_allowance_record_visible)
def test_can_reset_attempts(self):
"""
Make sure that Exam attempts are visible and can be reset.

View File

@@ -21,9 +21,6 @@ Feature: LMS.Answer problems
| checkbox | incorrect | always |
| radio | correct | always |
| radio | incorrect | always |
#| string | correct | always |
#| string | incorrect | always |
| numerical | correct | always |
| numerical | incorrect | always |
| formula | correct | always |
| formula | incorrect | always |

View File

@@ -44,6 +44,21 @@ To test WaffleSwitchNamespace, use the provided context managers. For example:
with WAFFLE_SWITCHES.override(waffle.ESTIMATE_FIRST_ATTEMPTED, active=True):
...
For long-lived flags, you may want to change the default for the flag from "off"
to "on", so that it is "on" by default in devstack, sandboxes, or new Open edX
releases, more closely matching what is in Production. This is for flags that
can't yet be deleted, for example if there are straggling course overrides.
* WaffleFlag has a DEPRECATED argument flag_undefined_default that we don't
recommend you use any more. Although this can work, it is proven not ideal to
have a value that isn't immediately obvious via Django admin.
* At this time, the proper alternative has not been fully designed. The
following food-for-thought could provide ideas for this design when needed:
using migrations, using app-level configuration, using management commands,
and/or creating records up front so all toggle defaults are explicit rather
than implicit.
"""
import crum
import logging
@@ -230,8 +245,9 @@ class WaffleFlagNamespace(WaffleNamespace):
check_before_waffle_callback(namespaced_flag_name) returns True
or False, it is returned. If it returns None, then waffle is
used.
flag_undefined_default (Boolean): A default value to be returned if
the waffle flag is to be checked, but doesn't exist.
DEPRECATED flag_undefined_default (Boolean): A default value to be
returned if the waffle flag is to be checked, but doesn't exist.
See docs for alternatives.
"""
# Import is placed here to avoid model import at project startup.
from waffle.models import Flag