def test_use_narrow_if_default_is_none(self): self.user_profile.default_events_register_stream_id = None self.user_profile.save() result = _default_narrow(self.user_profile, []) self.assertEqual(result, [])
def test_use_default_if_narrow_is_empty(self): 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')])
def test_use_passed_narrow_with_default(self): 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')])