populate_db: Re-enable push_notifications logger.

We were disabling push_notifications logger but weren't enabling
it back. This caused failures on porting logging mocks to assertLogs
as assertLogs expects a log to be generated.

See 9c224ccdd3 for why we disable
these. (To avoid logs spam from push_notifications_logger)
This commit is contained in:
Dinesh 2021-07-26 22:29:34 +05:30 committed by Tim Abbott
parent cb998f7147
commit e4fb2883b4
1 changed files with 5 additions and 4 deletions

View File

@ -118,10 +118,6 @@ def clear_database() -> None:
Session.objects.all().delete()
# Suppress spammy output from the push notifications logger
push_notifications_logger.disabled = True
def subscribe_users_to_streams(realm: Realm, stream_dict: Dict[str, Dict[str, Any]]) -> None:
subscriptions_to_add = []
event_time = timezone_now()
@ -273,6 +269,9 @@ class Command(BaseCommand):
)
def handle(self, **options: Any) -> None:
# Suppress spammy output from the push notifications logger
push_notifications_logger.disabled = True
if options["percent_huddles"] + options["percent_personals"] > 100:
self.stderr.write("Error! More than 100% of messages allocated.\n")
return
@ -899,6 +898,8 @@ class Command(BaseCommand):
mark_all_messages_as_read()
self.stdout.write("Successfully populated test database.\n")
push_notifications_logger.disabled = False
def mark_all_messages_as_read() -> None:
"""