Make get_room_version use cached get_room_version_id. (#11808)

This commit is contained in:
lukasdenk 2022-03-02 11:35:34 +01:00 committed by GitHub
parent 5f62a094de
commit 8e56a1b73c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 18 additions and 15 deletions

View file

@ -658,7 +658,7 @@ class SpaceSummaryTestCase(unittest.HomeserverTestCase):
def test_unknown_room_version(self):
"""
If an room with an unknown room version is encountered it should not cause
If a room with an unknown room version is encountered it should not cause
the entire summary to skip.
"""
# Poke the database and update the room version to an unknown one.
@ -670,6 +670,9 @@ class SpaceSummaryTestCase(unittest.HomeserverTestCase):
desc="updated-room-version",
)
)
# Invalidate method so that it returns the currently updated version
# instead of the cached version.
self.hs.get_datastores().main.get_room_version_id.invalidate((self.room,))
# The result should have only the space, along with a link from space -> room.
expected = [(self.space, [self.room])]