Fix flaky time-based test.

For testing waiting period thresholds, we need to
explicitly set date_joined for Hamlet to be now.
This commit is contained in:
Steve Howell 2017-05-29 11:54:06 -06:00
parent 43e76816ff
commit 1f4e1ece3a
1 changed files with 3 additions and 0 deletions

View File

@ -5,6 +5,7 @@ from typing import Any, Dict, List, Mapping, Optional, Sequence, Set, Text
from django.conf import settings
from django.http import HttpRequest, HttpResponse
from django.utils.timezone import now as timezone_now
from zerver.lib import cache
@ -654,6 +655,8 @@ class StreamAdminTest(ZulipTestCase):
threshold should be able to create new streams.
"""
user_profile = self.example_user('hamlet')
user_profile.date_joined = timezone_now()
user_profile.save()
email = user_profile.email
self.login(email)
do_change_is_admin(user_profile, False)