hotspots: Add ALWAYS_SEND_ALL_HOTSPOTS in dev_settings.

Replace the local variable SEND_ALL from get_next_hotspots.
Add unit test for the same.
This commit is contained in:
Nikhil Kumar Mishra
2018-03-19 01:29:10 +05:30
committed by Tim Abbott
parent a5472ddee7
commit f29a1918f3
4 changed files with 17 additions and 3 deletions

View File

@@ -28,9 +28,10 @@ ALL_HOTSPOTS = {
} # type: Dict[str, Dict[str, Text]]
def get_next_hotspots(user: UserProfile) -> List[Dict[str, object]]:
# Only used for manual testing
SEND_ALL = False
if settings.DEVELOPMENT and SEND_ALL:
# For manual testing, it can be convenient to set
# ALWAYS_SEND_ALL_HOTSPOTS=True in `zproject/dev_settings.py` to
# make it easy to click on all of the hotspots.
if settings.ALWAYS_SEND_ALL_HOTSPOTS:
return [{
'name': hotspot,
'title': ALL_HOTSPOTS[hotspot]['title'],