Skip to content

armgit / zulip

Public Imported from GitHub
0

Zulip server and web application. Open-source team chat that helps teams stay productive and focused.

mattermost: Make sure channels with digit-only names can be imported.

PieterCKbb25457612c0
diff --git a/zerver/tests/fixtures/mattermost_v11.1.0_fixtures/raw_mmctl_output/import.jsonl b/zerver/tests/fixtures/mattermost_v11.1.0_fixtures/raw_mmctl_output/import.jsonl
index fc3fb77e0c8..033a87b43a7 100644
--- a/zerver/tests/fixtures/mattermost_v11.1.0_fixtures/raw_mmctl_output/import.jsonl
+++ b/zerver/tests/fixtures/mattermost_v11.1.0_fixtures/raw_mmctl_output/import.jsonl
@@ -27,6 +27,7 @@
{"type":"channel","channel":{"team":"ad-1","name":"private-channel","display_name":"private-channel","type":"P","header":"","purpose":"","deleted_at":0}}
{"type":"channel","channel":{"team":"ad-1","name":"minus-6","display_name":"nostrum","type":"O","header":"quidem labore dolor hic aperiam. laboriosam cum quod maiores. itaque reprehenderit nostrum aut consequuntur. odit explicabo officiis!","purpose":"dolores minus tempore quidem voluptatem quod quibusdam asperiores ducimus. qui id nostrum veritatis nobis. tenetur iure qui nulla. dignissimos amet voluptas soluta natus.","deleted_at":0}}
{"type":"channel","channel":{"team":"ad-1","name":"sequi-7","display_name":"nesciunt","type":"O","header":"qui deleniti qui nobis recusandae. sed quos magni dicta itaque quod. sit reprehenderit sint quas alias ut. facilis aut ut ut et officia aut ipsam sit. officia maiores est illo expedita harum laudantium rerum. sunt eum eum ut voluptatum. exercitationem sint ea cum aut possimus id tempora doloribus sit eligendi.","purpose":"ad eos eaque itaque maiores recusandae facilis. voluptatum modi cupiditate temporibus voluptas voluptate. voluptate vel eum ut doloremque est. illo et repudiandae hic. ex quaerat consequuntur quae rem. possimus numquam maxime vel. enim dolor non labo","deleted_at":0}}
+{"type":"channel","channel":{"team":"ad-1","name":"123","display_name":"321","type":"O","header":"digit only channel","purpose":"","deleted_at":0}}
{"type":"user","user":{"profile_image":"users/19hyyxn9nbdwxe8hykj5fxmgwe/profile.png","username":"sysadmin","email":"[email protected]","auth_service":null,"nickname":"","first_name":"Kenneth","last_name":"Moreno","position":"Software Test Engineer ","roles":"system_admin system_user","locale":"en","delete_at":0,"teams":[{"name":"ad-1","roles":"team_admin team_user","channels":[{"name":"sequi-7","roles":"channel_user","notify_props":{"desktop":"default","mobile":"default","mark_unread":"all"},"favorite":false,"mention_count":0,"mention_count_root":0,"urgend_mention_count":0,"msg_count":0,"msg_count_root":0,"last_viewed_at":0},{"name":"minus-6","roles":"channel_user","notify_props":{"desktop":"default","mobile":"default","mark_unread":"all"},"favorite":false,"mention_count":0,"mention_count_root":0,"urgend_mention_count":0,"msg_count":0,"msg_count_root":0,"last_viewed_at":0},{"name":"town-square","roles":"channel_user","notify_props":{"desktop":"default","mobile":"default","mark_unread":"all"},"favorite":false,"mention_count":0,"mention_count_root":0,"urgend_mention_count":0,"msg_count":0,"msg_count_root":0,"last_viewed_at":0}]}],"military_time":"false","link_previews":"false","message_display":"clean","channel_display_mode":"full","tutorial_step":"999","notify_props":{"desktop":"mention","desktop_sound":"true","email":"true","mobile":"mention","mobile_push_status":"online","channel":"true","comments":"never","mention_keys":""}}}
{"type":"user","user":{"profile_image":"users/3iwnwsnax3ng8k6d7j6517na1y/profile.png","username":"kenneth.simmons","email":"[email protected]","auth_service":null,"nickname":"","first_name":"Kenneth","last_name":"Simmons","position":"Analyst Programmer","roles":"system_user","locale":"en","delete_at":0,"teams":[{"name":"ad-1","roles":"team_user","channels":[{"name":"minus-6","roles":"channel_user","notify_props":{"desktop":"default","mobile":"default","mark_unread":"all"},"favorite":false,"mention_count":0,"mention_count_root":0,"urgend_mention_count":0,"msg_count":0,"msg_count_root":0,"last_viewed_at":0},{"name":"town-square","roles":"channel_user","notify_props":{"desktop":"default","mobile":"default","mark_unread":"all"},"favorite":false,"mention_count":0,"mention_count_root":0,"urgend_mention_count":0,"msg_count":0,"msg_count_root":0,"last_viewed_at":0}]}],"military_time":"false","link_previews":"false","message_display":"compact","channel_display_mode":"full","tutorial_step":"999","notify_props":{"desktop":"mention","desktop_sound":"true","email":"true","mobile":"mention","mobile_push_status":"online","channel":"true","comments":"never","mention_keys":""}}}
{"type":"user","user":{"profile_image":"users/9wmomqujxtdmde5iqwfapa1omy/profile.png","username":"rebecca.diaz","email":"[email protected]","auth_service":null,"nickname":"","first_name":"Rebecca","last_name":"Diaz","position":"Help Desk Operator","roles":"system_user","locale":"en","delete_at":0,"teams":[{"name":"ad-1","roles":"team_user","channels":[{"name":"minus-6","roles":"channel_user","notify_props":{"desktop":"default","mobile":"default","mark_unread":"all"},"favorite":false,"mention_count":0,"mention_count_root":0,"urgend_mention_count":0,"msg_count":0,"msg_count_root":0,"last_viewed_at":0},{"name":"sequi-7","roles":"channel_user","notify_props":{"desktop":"default","mobile":"default","mark_unread":"all"},"favorite":false,"mention_count":0,"mention_count_root":0,"urgend_mention_count":0,"msg_count":0,"msg_count_root":0,"last_viewed_at":0},{"name":"town-square","roles":"channel_user","notify_props":{"desktop":"default","mobile":"default","mark_unread":"all"},"favorite":false,"mention_count":0,"mention_count_root":0,"urgend_mention_count":0,"msg_count":0,"msg_count_root":0,"last_viewed_at":0}]}],"military_time":"false","link_previews":"true","message_display":"compact","channel_display_mode":"full","tutorial_step":"1","notify_props":{"desktop":"mention","desktop_sound":"true","email":"true","mobile":"mention","mobile_push_status":"online","channel":"true","comments":"never","mention_keys":""}}}
diff --git a/zerver/tests/test_mattermost_importer.py b/zerver/tests/test_mattermost_importer.py
index 8bc5f81b107..fbe5248eee3 100644
--- a/zerver/tests/test_mattermost_importer.py
+++ b/zerver/tests/test_mattermost_importer.py
@@ -1602,7 +1602,7 @@ class MattermostV1110ImportTest(MattermostImportTestBase):
self.assert_length(mattermost_data, 8)
self.assert_length(mattermost_data["team"], 1)
self.assertEqual(mattermost_data["team"][0]["name"], "ad-1")
- self.assert_length(mattermost_data["channel"], 4)
+ self.assert_length(mattermost_data["channel"], 5)
self.assert_length(mattermost_data["user"], 20)
self.assert_length(mattermost_data["emoji"], 0)
self.assert_length(mattermost_data["post"]["channel_post"], 50)