summary refs log tree commit diff
path: root/tests
diff options
context:
space:
mode:
authorNeil Johnson <neil@matrix.org>2018-08-17 14:04:15 +0100
committerNeil Johnson <neil@matrix.org>2018-08-17 14:04:15 +0100
commitb5f638f1f478d2e7912d7afc454e881f4677d78c (patch)
tree2194c747d8c267e2d1f5c490faf80867dba61fc7 /tests
parentflake8 (diff)
parentMerge pull request #3708 from matrix-org/neilj/resource_Limit_block_event_cre... (diff)
downloadsynapse-b5f638f1f478d2e7912d7afc454e881f4677d78c.tar.xz
Merge branch 'develop' of github.com:matrix-org/synapse into neilj/server_notices_on_blocking
Diffstat (limited to 'tests')
-rw-r--r--tests/storage/test_monthly_active_users.py13
1 files changed, 13 insertions, 0 deletions
diff --git a/tests/storage/test_monthly_active_users.py b/tests/storage/test_monthly_active_users.py
index 511acbde9b..f2ed866ae7 100644
--- a/tests/storage/test_monthly_active_users.py
+++ b/tests/storage/test_monthly_active_users.py
@@ -75,6 +75,19 @@ class MonthlyActiveUsersTestCase(tests.unittest.TestCase):
         active_count = yield self.store.get_monthly_active_count()
         self.assertEquals(active_count, user_num)
 
+        # Test that regalar users are removed from the db
+        ru_count = 2
+        yield self.store.upsert_monthly_active_user("@ru1:server")
+        yield self.store.upsert_monthly_active_user("@ru2:server")
+        active_count = yield self.store.get_monthly_active_count()
+
+        self.assertEqual(active_count, user_num + ru_count)
+        self.hs.config.max_mau_value = user_num
+        yield self.store.reap_monthly_active_users()
+
+        active_count = yield self.store.get_monthly_active_count()
+        self.assertEquals(active_count, user_num)
+
     @defer.inlineCallbacks
     def test_can_insert_and_count_mau(self):
         count = yield self.store.get_monthly_active_count()