diff --git a/tests/rulecheck/test_domainrulecheck.py b/tests/rulecheck/test_domainrulecheck.py
index 803d680cec..e3167aa06b 100644
--- a/tests/rulecheck/test_domainrulecheck.py
+++ b/tests/rulecheck/test_domainrulecheck.py
@@ -32,6 +32,7 @@ class DomainRuleCheckerTestCase(unittest.TestCase):
"source_one": ["target_one", "target_two"],
"source_two": ["target_two"],
},
+ "domains_prevented_from_being_invited_to_published_rooms": ["target_two"]
}
check = DomainRuleChecker(config)
self.assertTrue(
@@ -50,6 +51,20 @@ class DomainRuleCheckerTestCase(unittest.TestCase):
)
)
+ # User can invite internal user to a published room
+ self.assertTrue(
+ check.user_may_invite(
+ "test:source_one", "test1:target_one", None, "room", False, True,
+ )
+ )
+
+ # User can invite external user to a non-published room
+ self.assertTrue(
+ check.user_may_invite(
+ "test:source_one", "test:target_two", None, "room", False, False,
+ )
+ )
+
def test_disallowed(self):
config = {
"default": True,
@@ -81,6 +96,13 @@ class DomainRuleCheckerTestCase(unittest.TestCase):
)
)
+ # User cannot invite external user to a published room
+ self.assertTrue(
+ check.user_may_invite(
+ "test:source_one", "test:target_two", None, "room", False, True,
+ )
+ )
+
def test_default_allow(self):
config = {
"default": True,
|