summary refs log tree commit diff
path: root/tests/test_mau.py
diff options
context:
space:
mode:
authorRichard van der Hoff <richard@matrix.org>2018-11-20 11:03:35 +0000
committerRichard van der Hoff <richard@matrix.org>2018-11-20 11:03:35 +0000
commit28e28a1974d89fc3cdf06cae36a3ebc16e2ff504 (patch)
treefebd9f48f5212fd0762f8f72bbbf28c954905fbe /tests/test_mau.py
parentMerge branch 'develop' into matrix-org-hotfixes (diff)
parentMerge remote-tracking branch 'origin/master' into develop (diff)
downloadsynapse-28e28a1974d89fc3cdf06cae36a3ebc16e2ff504.tar.xz
Merge branch 'develop' into matrix-org-hotfixes
Diffstat (limited to 'tests/test_mau.py')
-rw-r--r--tests/test_mau.py18
1 files changed, 18 insertions, 0 deletions
diff --git a/tests/test_mau.py b/tests/test_mau.py

index 0afdeb0818..04f95c942f 100644 --- a/tests/test_mau.py +++ b/tests/test_mau.py
@@ -171,6 +171,24 @@ class TestMauLimit(unittest.HomeserverTestCase): self.assertEqual(e.code, 403) self.assertEqual(e.errcode, Codes.RESOURCE_LIMIT_EXCEEDED) + def test_tracked_but_not_limited(self): + self.hs.config.max_mau_value = 1 # should not matter + self.hs.config.limit_usage_by_mau = False + self.hs.config.mau_stats_only = True + + # Simply being able to create 2 users indicates that the + # limit was not reached. + token1 = self.create_user("kermit1") + self.do_sync_for_user(token1) + token2 = self.create_user("kermit2") + self.do_sync_for_user(token2) + + # We do want to verify that the number of tracked users + # matches what we want though + count = self.store.get_monthly_active_count() + self.reactor.advance(100) + self.assertEqual(2, self.successResultOf(count)) + def create_user(self, localpart): request_data = json.dumps( {