def test_use_narrow_if_default_is_none(self) -> None:
     self.user_profile.default_events_register_stream_id = None
     self.user_profile.save()
     result = _default_narrow(self.user_profile, [])
     self.assertEqual(result, [])
Exemple #2
0
 def test_use_passed_narrow_with_default(self) -> None:
     self.user_profile.default_events_register_stream_id = self.stream.id
     self.user_profile.save()
     result = _default_narrow(self.user_profile, [["stream", "my_stream"]])
     self.assertEqual(result, [["stream", "my_stream"]])
 def test_use_default_if_narrow_is_empty(self) -> None:
     self.user_profile.default_events_register_stream_id = self.stream.id
     self.user_profile.save()
     result = _default_narrow(self.user_profile, [])
     self.assertEqual(result, [["stream", "Verona"]])