mirror of https://github.com/zulip/zulip.git
parent
e071d27b6b
commit
2e7d0cb4cb
|
@ -162,7 +162,7 @@ def gather_new_streams(user_profile: UserProfile,
|
|||
new_streams = list(get_active_streams(user_profile.realm).filter(
|
||||
invite_only=False, date_created__gt=threshold))
|
||||
|
||||
base_url = u"%s/ # narrow/stream/" % (user_profile.realm.uri,)
|
||||
base_url = u"%s/#narrow/stream/" % (user_profile.realm.uri,)
|
||||
|
||||
streams_html = []
|
||||
streams_plain = []
|
||||
|
|
|
@ -26,6 +26,7 @@ from zerver.models import (
|
|||
)
|
||||
|
||||
from zerver.lib.actions import (
|
||||
create_stream_if_needed,
|
||||
encode_email_address,
|
||||
do_create_user
|
||||
)
|
||||
|
@ -35,7 +36,7 @@ from zerver.lib.email_mirror import (
|
|||
get_missed_message_token_from_address,
|
||||
)
|
||||
|
||||
from zerver.lib.digest import handle_digest_email, enqueue_emails
|
||||
from zerver.lib.digest import gather_new_streams, handle_digest_email, enqueue_emails
|
||||
from zerver.lib.send_email import FromAddress
|
||||
from zerver.lib.notifications import (
|
||||
handle_missedmessage_emails,
|
||||
|
@ -372,6 +373,16 @@ class TestDigestEmailMessages(ZulipTestCase):
|
|||
user = arg[0][0]
|
||||
self.assertNotEqual(user.id, bot.id)
|
||||
|
||||
@mock.patch('zerver.lib.digest.timezone_now')
|
||||
def test_new_stream_link(self, mock_django_timezone: mock.MagicMock) -> None:
|
||||
cutoff = datetime.datetime(year=2017, month=11, day=1)
|
||||
mock_django_timezone.return_value = datetime.datetime(year=2017, month=11, day=5)
|
||||
cordelia = self.example_user('cordelia')
|
||||
create_stream_if_needed(cordelia.realm, 'New stream')
|
||||
new_stream = gather_new_streams(cordelia, cutoff)[1]
|
||||
expected_html = "<a href='http://zulip.testserver/#narrow/stream/New.20stream'>New stream</a>"
|
||||
self.assertIn(expected_html, new_stream['html'])
|
||||
|
||||
class TestReplyExtraction(ZulipTestCase):
|
||||
def test_reply_is_extracted_from_plain(self) -> None:
|
||||
|
||||
|
|
Loading…
Reference in New Issue