Re-enable desktop notifications in automated testing

After c1d98239 the function works in CasperJS as well.

Reverts some of 90f4d6ac3ddb387e74051b9af2c230698fa94479.

(imported from commit 3579df33930bb34dc081908b84900905eee6d270)
This commit is contained in:
Keegan McAllister 2013-02-26 18:02:20 -05:00
parent d3ebe22a58
commit cc19afd0fe
2 changed files with 1 additions and 8 deletions

View File

@ -15,10 +15,6 @@ else:
# This allows CasperJS to proceed quickly to the next test step. # This allows CasperJS to proceed quickly to the next test step.
POLL_TIMEOUT = 1000 POLL_TIMEOUT = 1000
# Disable desktop notifications because CasperJS can't handle them;
# window.webkitNotifications.requestPermission() throws a type error
ENABLE_NOTIFICATIONS = False
# Don't use the real message log for tests # Don't use the real message log for tests
EVENT_LOG_DIR = '/tmp/humbug-test-event-log' EVENT_LOG_DIR = '/tmp/humbug-test-event-log'

View File

@ -401,9 +401,6 @@ def home(request):
streams = simplejson.encoder.JSONEncoderForHTML().encode(gather_subscriptions(user_profile)) streams = simplejson.encoder.JSONEncoderForHTML().encode(gather_subscriptions(user_profile))
desktop_notifications_enabled = (user_profile.enable_desktop_notifications
and getattr(settings, 'ENABLE_NOTIFICATIONS', True))
js_bool = lambda x: 'true' if x else 'false' js_bool = lambda x: 'true' if x else 'false'
try: try:
@ -421,7 +418,7 @@ def home(request):
'have_initial_messages': 'have_initial_messages':
js_bool(num_messages > 0), js_bool(num_messages > 0),
'desktop_notifications_enabled': 'desktop_notifications_enabled':
js_bool(desktop_notifications_enabled), js_bool(user_profile.enable_desktop_notifications),
'show_debug': 'show_debug':
settings.DEBUG and ('show_debug' in request.GET), settings.DEBUG and ('show_debug' in request.GET),
'show_activity': can_view_activity(request), 'show_activity': can_view_activity(request),