fix test_auto_create_auto_join_where_no_consent#4886
Conversation
| """Test to ensure that the first user is not auto-joined to a room if | ||
| they have not given general consent. | ||
| """ | ||
| self.hs.config.user_consent_at_registration = True |
There was a problem hiding this comment.
does this and the next line actually do anything? I'd expect them to be redundant now.
| # * The server is configured to auto-join to a room | ||
| # (and autocreate if necessary) | ||
| event_creation_handler = self.hs.get_event_creation_handler() | ||
| event_creation_handler._block_events_without_consent_error = ( |
There was a problem hiding this comment.
I'm a bit dubious about this poking into the guts of EventCreationHandler - it looks fragile. OTOH I can't really think of a better way of testing it, other than creating a new test class (possibly a subclass of RegistrationTestCase) which uses a different config - which might be a bit fiddly right now.
There was a problem hiding this comment.
Yeah this really mings - I'll comment explicitly to make it clearer
| room_alias_str = "#room:test" | ||
| self.hs.config.auto_join_rooms = [room_alias_str] | ||
|
|
||
| # When the user is registered, and post consent actions are called |
There was a problem hiding this comment.
this doesn't seem to make sense?
There was a problem hiding this comment.
I've tried to make it clearer with formatting
Codecov Report
@@ Coverage Diff @@
## develop #4886 +/- ##
===========================================
- Coverage 77.87% 77.68% -0.19%
===========================================
Files 326 326
Lines 33949 34620 +671
Branches 5597 5811 +214
===========================================
+ Hits 26437 26896 +459
- Misses 5902 6068 +166
- Partials 1610 1656 +46 |
richvdh
left a comment
There was a problem hiding this comment.
can you rename the changelog to be a .misc; it's not a user-facing bug
|
(lgtm other than the changelog) |
No description provided.