mirror of
https://github.com/zulip/zulip.git
synced 2025-11-02 21:13:36 +00:00
auth: Rewrite data model for tracking enabled auth backends.
So far, we've used the BitField .authentication_methods on Realm for tracking which backends are enabled for an organization. This however made it a pain to add new backends (requiring altering the column and a migration - particularly troublesome if someone wanted to create their own custom auth backend for their server). Instead this will be tracked through the existence of the appropriate rows in the RealmAuthenticationMethods table.
This commit is contained in:
committed by
Tim Abbott
parent
41f17bf392
commit
ffa3aa8487
@@ -734,7 +734,7 @@ class SlackImporter(ZulipTestCase):
|
||||
passed_realm["zerver_realm"][0]["description"], "Organization imported from Slack!"
|
||||
)
|
||||
self.assertEqual(passed_realm["zerver_userpresence"], [])
|
||||
self.assert_length(passed_realm.keys(), 15)
|
||||
self.assert_length(passed_realm.keys(), 16)
|
||||
|
||||
self.assertEqual(realm["zerver_stream"], [])
|
||||
self.assertEqual(realm["zerver_userprofile"], [])
|
||||
@@ -1148,6 +1148,10 @@ class SlackImporter(ZulipTestCase):
|
||||
|
||||
self.assertEqual(Message.objects.filter(realm=realm).count(), 82)
|
||||
|
||||
# All auth backends are enabled initially.
|
||||
for name, enabled in realm.authentication_methods_dict().items():
|
||||
self.assertTrue(enabled)
|
||||
|
||||
Realm.objects.filter(name=test_realm_subdomain).delete()
|
||||
|
||||
remove_folder(output_dir)
|
||||
|
||||
Reference in New Issue
Block a user