mirror of
https://github.com/zulip/zulip.git
synced 2025-10-31 20:13:46 +00:00
validators: Use cleaner syntax for AfterValidator.
Created a function that returns an `AfterValidator` for `check_int_in` and `check_string_in` instead of having to use a `lambda` wraper everytime.
This commit is contained in:
committed by
Tim Abbott
parent
0ec4b0285e
commit
a7da24a36f
@@ -688,6 +688,26 @@ class UnmutedTopicsTests(ZulipTestCase):
|
||||
self.assert_json_error(result, "Invalid channel ID")
|
||||
|
||||
|
||||
class UserTopicsTests(ZulipTestCase):
|
||||
def test_invalid_visibility_policy(self) -> None:
|
||||
user = self.example_user("hamlet")
|
||||
self.login_user(user)
|
||||
|
||||
stream = get_stream("Verona", user.realm)
|
||||
|
||||
url = "/api/v1/user_topics"
|
||||
data = {
|
||||
"stream_id": stream.id,
|
||||
"topic": "Verona3",
|
||||
"visibility_policy": 999,
|
||||
}
|
||||
|
||||
result = self.api_post(user, url, data)
|
||||
self.assert_json_error(
|
||||
result, "Invalid visibility_policy: Value error, Not in the list of possible values"
|
||||
)
|
||||
|
||||
|
||||
class AutomaticallyFollowTopicsTests(ZulipTestCase):
|
||||
def test_automatically_follow_topic_on_initiation(self) -> None:
|
||||
hamlet = self.example_user("hamlet")
|
||||
|
||||
Reference in New Issue
Block a user