6 AdminPurgeCommunityForm,
18 ModBanFromCommunityForm,
28 ModRemoveCommunityForm,
32 ModTransferCommunityForm,
35 utils::{get_conn, DbPool},
37 use diesel::{dsl::insert_into, result::Error, QueryDsl};
38 use diesel_async::RunQueryDsl;
41 impl Crud for ModRemovePost {
42 type InsertForm = ModRemovePostForm;
43 type UpdateForm = ModRemovePostForm;
45 async fn read(pool: &mut DbPool<'_>, from_id: i32) -> Result<Self, Error> {
46 use crate::schema::mod_remove_post::dsl::mod_remove_post;
47 let conn = &mut get_conn(pool).await?;
48 mod_remove_post.find(from_id).first::<Self>(conn).await
51 async fn create(pool: &mut DbPool<'_>, form: &ModRemovePostForm) -> Result<Self, Error> {
52 use crate::schema::mod_remove_post::dsl::mod_remove_post;
53 let conn = &mut get_conn(pool).await?;
54 insert_into(mod_remove_post)
56 .get_result::<Self>(conn)
61 pool: &mut DbPool<'_>,
63 form: &ModRemovePostForm,
64 ) -> Result<Self, Error> {
65 use crate::schema::mod_remove_post::dsl::mod_remove_post;
66 let conn = &mut get_conn(pool).await?;
67 diesel::update(mod_remove_post.find(from_id))
69 .get_result::<Self>(conn)
75 impl Crud for ModLockPost {
76 type InsertForm = ModLockPostForm;
77 type UpdateForm = ModLockPostForm;
79 async fn read(pool: &mut DbPool<'_>, from_id: i32) -> Result<Self, Error> {
80 use crate::schema::mod_lock_post::dsl::mod_lock_post;
81 let conn = &mut get_conn(pool).await?;
82 mod_lock_post.find(from_id).first::<Self>(conn).await
85 async fn create(pool: &mut DbPool<'_>, form: &ModLockPostForm) -> Result<Self, Error> {
86 use crate::schema::mod_lock_post::dsl::mod_lock_post;
87 let conn = &mut get_conn(pool).await?;
88 insert_into(mod_lock_post)
90 .get_result::<Self>(conn)
95 pool: &mut DbPool<'_>,
97 form: &ModLockPostForm,
98 ) -> Result<Self, Error> {
99 use crate::schema::mod_lock_post::dsl::mod_lock_post;
100 let conn = &mut get_conn(pool).await?;
101 diesel::update(mod_lock_post.find(from_id))
103 .get_result::<Self>(conn)
109 impl Crud for ModFeaturePost {
110 type InsertForm = ModFeaturePostForm;
111 type UpdateForm = ModFeaturePostForm;
113 async fn read(pool: &mut DbPool<'_>, from_id: i32) -> Result<Self, Error> {
114 use crate::schema::mod_feature_post::dsl::mod_feature_post;
115 let conn = &mut get_conn(pool).await?;
116 mod_feature_post.find(from_id).first::<Self>(conn).await
119 async fn create(pool: &mut DbPool<'_>, form: &ModFeaturePostForm) -> Result<Self, Error> {
120 use crate::schema::mod_feature_post::dsl::mod_feature_post;
121 let conn = &mut get_conn(pool).await?;
122 insert_into(mod_feature_post)
124 .get_result::<Self>(conn)
129 pool: &mut DbPool<'_>,
131 form: &ModFeaturePostForm,
132 ) -> Result<Self, Error> {
133 use crate::schema::mod_feature_post::dsl::mod_feature_post;
134 let conn = &mut get_conn(pool).await?;
135 diesel::update(mod_feature_post.find(from_id))
137 .get_result::<Self>(conn)
143 impl Crud for ModRemoveComment {
144 type InsertForm = ModRemoveCommentForm;
145 type UpdateForm = ModRemoveCommentForm;
147 async fn read(pool: &mut DbPool<'_>, from_id: i32) -> Result<Self, Error> {
148 use crate::schema::mod_remove_comment::dsl::mod_remove_comment;
149 let conn = &mut get_conn(pool).await?;
150 mod_remove_comment.find(from_id).first::<Self>(conn).await
153 async fn create(pool: &mut DbPool<'_>, form: &ModRemoveCommentForm) -> Result<Self, Error> {
154 use crate::schema::mod_remove_comment::dsl::mod_remove_comment;
155 let conn = &mut get_conn(pool).await?;
156 insert_into(mod_remove_comment)
158 .get_result::<Self>(conn)
163 pool: &mut DbPool<'_>,
165 form: &ModRemoveCommentForm,
166 ) -> Result<Self, Error> {
167 use crate::schema::mod_remove_comment::dsl::mod_remove_comment;
168 let conn = &mut get_conn(pool).await?;
169 diesel::update(mod_remove_comment.find(from_id))
171 .get_result::<Self>(conn)
177 impl Crud for ModRemoveCommunity {
178 type InsertForm = ModRemoveCommunityForm;
179 type UpdateForm = ModRemoveCommunityForm;
181 async fn read(pool: &mut DbPool<'_>, from_id: i32) -> Result<Self, Error> {
182 use crate::schema::mod_remove_community::dsl::mod_remove_community;
183 let conn = &mut get_conn(pool).await?;
184 mod_remove_community.find(from_id).first::<Self>(conn).await
187 async fn create(pool: &mut DbPool<'_>, form: &ModRemoveCommunityForm) -> Result<Self, Error> {
188 use crate::schema::mod_remove_community::dsl::mod_remove_community;
189 let conn = &mut get_conn(pool).await?;
190 insert_into(mod_remove_community)
192 .get_result::<Self>(conn)
197 pool: &mut DbPool<'_>,
199 form: &ModRemoveCommunityForm,
200 ) -> Result<Self, Error> {
201 use crate::schema::mod_remove_community::dsl::mod_remove_community;
202 let conn = &mut get_conn(pool).await?;
203 diesel::update(mod_remove_community.find(from_id))
205 .get_result::<Self>(conn)
211 impl Crud for ModBanFromCommunity {
212 type InsertForm = ModBanFromCommunityForm;
213 type UpdateForm = ModBanFromCommunityForm;
215 async fn read(pool: &mut DbPool<'_>, from_id: i32) -> Result<Self, Error> {
216 use crate::schema::mod_ban_from_community::dsl::mod_ban_from_community;
217 let conn = &mut get_conn(pool).await?;
218 mod_ban_from_community
224 async fn create(pool: &mut DbPool<'_>, form: &ModBanFromCommunityForm) -> Result<Self, Error> {
225 use crate::schema::mod_ban_from_community::dsl::mod_ban_from_community;
226 let conn = &mut get_conn(pool).await?;
227 insert_into(mod_ban_from_community)
229 .get_result::<Self>(conn)
234 pool: &mut DbPool<'_>,
236 form: &ModBanFromCommunityForm,
237 ) -> Result<Self, Error> {
238 use crate::schema::mod_ban_from_community::dsl::mod_ban_from_community;
239 let conn = &mut get_conn(pool).await?;
240 diesel::update(mod_ban_from_community.find(from_id))
242 .get_result::<Self>(conn)
248 impl Crud for ModBan {
249 type InsertForm = ModBanForm;
250 type UpdateForm = ModBanForm;
252 async fn read(pool: &mut DbPool<'_>, from_id: i32) -> Result<Self, Error> {
253 use crate::schema::mod_ban::dsl::mod_ban;
254 let conn = &mut get_conn(pool).await?;
255 mod_ban.find(from_id).first::<Self>(conn).await
258 async fn create(pool: &mut DbPool<'_>, form: &ModBanForm) -> Result<Self, Error> {
259 use crate::schema::mod_ban::dsl::mod_ban;
260 let conn = &mut get_conn(pool).await?;
263 .get_result::<Self>(conn)
267 async fn update(pool: &mut DbPool<'_>, from_id: i32, form: &ModBanForm) -> Result<Self, Error> {
268 use crate::schema::mod_ban::dsl::mod_ban;
269 let conn = &mut get_conn(pool).await?;
270 diesel::update(mod_ban.find(from_id))
272 .get_result::<Self>(conn)
278 impl Crud for ModHideCommunity {
279 type InsertForm = ModHideCommunityForm;
280 type UpdateForm = ModHideCommunityForm;
283 async fn read(pool: &mut DbPool<'_>, from_id: i32) -> Result<Self, Error> {
284 use crate::schema::mod_hide_community::dsl::mod_hide_community;
285 let conn = &mut get_conn(pool).await?;
286 mod_hide_community.find(from_id).first::<Self>(conn).await
289 async fn create(pool: &mut DbPool<'_>, form: &ModHideCommunityForm) -> Result<Self, Error> {
290 use crate::schema::mod_hide_community::dsl::mod_hide_community;
291 let conn = &mut get_conn(pool).await?;
292 insert_into(mod_hide_community)
294 .get_result::<Self>(conn)
299 pool: &mut DbPool<'_>,
301 form: &ModHideCommunityForm,
302 ) -> Result<Self, Error> {
303 use crate::schema::mod_hide_community::dsl::mod_hide_community;
304 let conn = &mut get_conn(pool).await?;
305 diesel::update(mod_hide_community.find(from_id))
307 .get_result::<Self>(conn)
313 impl Crud for ModAddCommunity {
314 type InsertForm = ModAddCommunityForm;
315 type UpdateForm = ModAddCommunityForm;
317 async fn read(pool: &mut DbPool<'_>, from_id: i32) -> Result<Self, Error> {
318 use crate::schema::mod_add_community::dsl::mod_add_community;
319 let conn = &mut get_conn(pool).await?;
320 mod_add_community.find(from_id).first::<Self>(conn).await
323 async fn create(pool: &mut DbPool<'_>, form: &ModAddCommunityForm) -> Result<Self, Error> {
324 use crate::schema::mod_add_community::dsl::mod_add_community;
325 let conn = &mut get_conn(pool).await?;
326 insert_into(mod_add_community)
328 .get_result::<Self>(conn)
333 pool: &mut DbPool<'_>,
335 form: &ModAddCommunityForm,
336 ) -> Result<Self, Error> {
337 use crate::schema::mod_add_community::dsl::mod_add_community;
338 let conn = &mut get_conn(pool).await?;
339 diesel::update(mod_add_community.find(from_id))
341 .get_result::<Self>(conn)
347 impl Crud for ModTransferCommunity {
348 type InsertForm = ModTransferCommunityForm;
349 type UpdateForm = ModTransferCommunityForm;
351 async fn read(pool: &mut DbPool<'_>, from_id: i32) -> Result<Self, Error> {
352 use crate::schema::mod_transfer_community::dsl::mod_transfer_community;
353 let conn = &mut get_conn(pool).await?;
354 mod_transfer_community
360 async fn create(pool: &mut DbPool<'_>, form: &ModTransferCommunityForm) -> Result<Self, Error> {
361 use crate::schema::mod_transfer_community::dsl::mod_transfer_community;
362 let conn = &mut get_conn(pool).await?;
363 insert_into(mod_transfer_community)
365 .get_result::<Self>(conn)
370 pool: &mut DbPool<'_>,
372 form: &ModTransferCommunityForm,
373 ) -> Result<Self, Error> {
374 use crate::schema::mod_transfer_community::dsl::mod_transfer_community;
375 let conn = &mut get_conn(pool).await?;
376 diesel::update(mod_transfer_community.find(from_id))
378 .get_result::<Self>(conn)
384 impl Crud for ModAdd {
385 type InsertForm = ModAddForm;
386 type UpdateForm = ModAddForm;
388 async fn read(pool: &mut DbPool<'_>, from_id: i32) -> Result<Self, Error> {
389 use crate::schema::mod_add::dsl::mod_add;
390 let conn = &mut get_conn(pool).await?;
391 mod_add.find(from_id).first::<Self>(conn).await
394 async fn create(pool: &mut DbPool<'_>, form: &ModAddForm) -> Result<Self, Error> {
395 use crate::schema::mod_add::dsl::mod_add;
396 let conn = &mut get_conn(pool).await?;
399 .get_result::<Self>(conn)
403 async fn update(pool: &mut DbPool<'_>, from_id: i32, form: &ModAddForm) -> Result<Self, Error> {
404 use crate::schema::mod_add::dsl::mod_add;
405 let conn = &mut get_conn(pool).await?;
406 diesel::update(mod_add.find(from_id))
408 .get_result::<Self>(conn)
414 impl Crud for AdminPurgePerson {
415 type InsertForm = AdminPurgePersonForm;
416 type UpdateForm = AdminPurgePersonForm;
418 async fn read(pool: &mut DbPool<'_>, from_id: i32) -> Result<Self, Error> {
419 use crate::schema::admin_purge_person::dsl::admin_purge_person;
420 let conn = &mut get_conn(pool).await?;
421 admin_purge_person.find(from_id).first::<Self>(conn).await
424 async fn create(pool: &mut DbPool<'_>, form: &Self::InsertForm) -> Result<Self, Error> {
425 use crate::schema::admin_purge_person::dsl::admin_purge_person;
426 let conn = &mut get_conn(pool).await?;
427 insert_into(admin_purge_person)
429 .get_result::<Self>(conn)
434 pool: &mut DbPool<'_>,
436 form: &Self::InsertForm,
437 ) -> Result<Self, Error> {
438 use crate::schema::admin_purge_person::dsl::admin_purge_person;
439 let conn = &mut get_conn(pool).await?;
440 diesel::update(admin_purge_person.find(from_id))
442 .get_result::<Self>(conn)
448 impl Crud for AdminPurgeCommunity {
449 type InsertForm = AdminPurgeCommunityForm;
450 type UpdateForm = AdminPurgeCommunityForm;
452 async fn read(pool: &mut DbPool<'_>, from_id: i32) -> Result<Self, Error> {
453 use crate::schema::admin_purge_community::dsl::admin_purge_community;
454 let conn = &mut get_conn(pool).await?;
455 admin_purge_community
461 async fn create(pool: &mut DbPool<'_>, form: &Self::InsertForm) -> Result<Self, Error> {
462 use crate::schema::admin_purge_community::dsl::admin_purge_community;
463 let conn = &mut get_conn(pool).await?;
464 insert_into(admin_purge_community)
466 .get_result::<Self>(conn)
471 pool: &mut DbPool<'_>,
473 form: &Self::InsertForm,
474 ) -> Result<Self, Error> {
475 use crate::schema::admin_purge_community::dsl::admin_purge_community;
476 let conn = &mut get_conn(pool).await?;
477 diesel::update(admin_purge_community.find(from_id))
479 .get_result::<Self>(conn)
485 impl Crud for AdminPurgePost {
486 type InsertForm = AdminPurgePostForm;
487 type UpdateForm = AdminPurgePostForm;
489 async fn read(pool: &mut DbPool<'_>, from_id: i32) -> Result<Self, Error> {
490 use crate::schema::admin_purge_post::dsl::admin_purge_post;
491 let conn = &mut get_conn(pool).await?;
492 admin_purge_post.find(from_id).first::<Self>(conn).await
495 async fn create(pool: &mut DbPool<'_>, form: &Self::InsertForm) -> Result<Self, Error> {
496 use crate::schema::admin_purge_post::dsl::admin_purge_post;
497 let conn = &mut get_conn(pool).await?;
498 insert_into(admin_purge_post)
500 .get_result::<Self>(conn)
505 pool: &mut DbPool<'_>,
507 form: &Self::InsertForm,
508 ) -> Result<Self, Error> {
509 use crate::schema::admin_purge_post::dsl::admin_purge_post;
510 let conn = &mut get_conn(pool).await?;
511 diesel::update(admin_purge_post.find(from_id))
513 .get_result::<Self>(conn)
519 impl Crud for AdminPurgeComment {
520 type InsertForm = AdminPurgeCommentForm;
521 type UpdateForm = AdminPurgeCommentForm;
523 async fn read(pool: &mut DbPool<'_>, from_id: i32) -> Result<Self, Error> {
524 use crate::schema::admin_purge_comment::dsl::admin_purge_comment;
525 let conn = &mut get_conn(pool).await?;
526 admin_purge_comment.find(from_id).first::<Self>(conn).await
529 async fn create(pool: &mut DbPool<'_>, form: &Self::InsertForm) -> Result<Self, Error> {
530 use crate::schema::admin_purge_comment::dsl::admin_purge_comment;
531 let conn = &mut get_conn(pool).await?;
532 insert_into(admin_purge_comment)
534 .get_result::<Self>(conn)
539 pool: &mut DbPool<'_>,
541 form: &Self::InsertForm,
542 ) -> Result<Self, Error> {
543 use crate::schema::admin_purge_comment::dsl::admin_purge_comment;
544 let conn = &mut get_conn(pool).await?;
545 diesel::update(admin_purge_comment.find(from_id))
547 .get_result::<Self>(conn)
556 comment::{Comment, CommentInsertForm},
557 community::{Community, CommunityInsertForm},
567 ModBanFromCommunityForm,
573 ModRemoveCommentForm,
575 ModRemoveCommunityForm,
579 person::{Person, PersonInsertForm},
580 post::{Post, PostInsertForm},
583 utils::build_db_pool_for_tests,
585 use serial_test::serial;
589 async fn test_crud() {
590 let pool = &build_db_pool_for_tests().await;
591 let pool = &mut pool.into();
593 let inserted_instance = Instance::read_or_create(pool, "my_domain.tld".to_string())
597 let new_mod = PersonInsertForm::builder()
598 .name("the mod".into())
599 .public_key("pubkey".to_string())
600 .instance_id(inserted_instance.id)
603 let inserted_mod = Person::create(pool, &new_mod).await.unwrap();
605 let new_person = PersonInsertForm::builder()
607 .public_key("pubkey".to_string())
608 .instance_id(inserted_instance.id)
611 let inserted_person = Person::create(pool, &new_person).await.unwrap();
613 let new_community = CommunityInsertForm::builder()
614 .name("mod_community".to_string())
615 .title("nada".to_owned())
616 .public_key("pubkey".to_string())
617 .instance_id(inserted_instance.id)
620 let inserted_community = Community::create(pool, &new_community).await.unwrap();
622 let new_post = PostInsertForm::builder()
623 .name("A test post thweep".into())
624 .creator_id(inserted_person.id)
625 .community_id(inserted_community.id)
628 let inserted_post = Post::create(pool, &new_post).await.unwrap();
630 let comment_form = CommentInsertForm::builder()
631 .content("A test comment".into())
632 .creator_id(inserted_person.id)
633 .post_id(inserted_post.id)
636 let inserted_comment = Comment::create(pool, &comment_form, None).await.unwrap();
638 // Now the actual tests
641 let mod_remove_post_form = ModRemovePostForm {
642 mod_person_id: inserted_mod.id,
643 post_id: inserted_post.id,
647 let inserted_mod_remove_post = ModRemovePost::create(pool, &mod_remove_post_form)
650 let read_mod_remove_post = ModRemovePost::read(pool, inserted_mod_remove_post.id)
653 let expected_mod_remove_post = ModRemovePost {
654 id: inserted_mod_remove_post.id,
655 post_id: inserted_post.id,
656 mod_person_id: inserted_mod.id,
659 when_: inserted_mod_remove_post.when_,
664 let mod_lock_post_form = ModLockPostForm {
665 mod_person_id: inserted_mod.id,
666 post_id: inserted_post.id,
669 let inserted_mod_lock_post = ModLockPost::create(pool, &mod_lock_post_form)
672 let read_mod_lock_post = ModLockPost::read(pool, inserted_mod_lock_post.id)
675 let expected_mod_lock_post = ModLockPost {
676 id: inserted_mod_lock_post.id,
677 post_id: inserted_post.id,
678 mod_person_id: inserted_mod.id,
680 when_: inserted_mod_lock_post.when_,
685 let mod_feature_post_form = ModFeaturePostForm {
686 mod_person_id: inserted_mod.id,
687 post_id: inserted_post.id,
689 is_featured_community: true,
691 let inserted_mod_feature_post = ModFeaturePost::create(pool, &mod_feature_post_form)
694 let read_mod_feature_post = ModFeaturePost::read(pool, inserted_mod_feature_post.id)
697 let expected_mod_feature_post = ModFeaturePost {
698 id: inserted_mod_feature_post.id,
699 post_id: inserted_post.id,
700 mod_person_id: inserted_mod.id,
702 is_featured_community: true,
703 when_: inserted_mod_feature_post.when_,
708 let mod_remove_comment_form = ModRemoveCommentForm {
709 mod_person_id: inserted_mod.id,
710 comment_id: inserted_comment.id,
714 let inserted_mod_remove_comment = ModRemoveComment::create(pool, &mod_remove_comment_form)
717 let read_mod_remove_comment = ModRemoveComment::read(pool, inserted_mod_remove_comment.id)
720 let expected_mod_remove_comment = ModRemoveComment {
721 id: inserted_mod_remove_comment.id,
722 comment_id: inserted_comment.id,
723 mod_person_id: inserted_mod.id,
726 when_: inserted_mod_remove_comment.when_,
731 let mod_remove_community_form = ModRemoveCommunityForm {
732 mod_person_id: inserted_mod.id,
733 community_id: inserted_community.id,
738 let inserted_mod_remove_community =
739 ModRemoveCommunity::create(pool, &mod_remove_community_form)
742 let read_mod_remove_community =
743 ModRemoveCommunity::read(pool, inserted_mod_remove_community.id)
746 let expected_mod_remove_community = ModRemoveCommunity {
747 id: inserted_mod_remove_community.id,
748 community_id: inserted_community.id,
749 mod_person_id: inserted_mod.id,
753 when_: inserted_mod_remove_community.when_,
756 // ban from community
758 let mod_ban_from_community_form = ModBanFromCommunityForm {
759 mod_person_id: inserted_mod.id,
760 other_person_id: inserted_person.id,
761 community_id: inserted_community.id,
766 let inserted_mod_ban_from_community =
767 ModBanFromCommunity::create(pool, &mod_ban_from_community_form)
770 let read_mod_ban_from_community =
771 ModBanFromCommunity::read(pool, inserted_mod_ban_from_community.id)
774 let expected_mod_ban_from_community = ModBanFromCommunity {
775 id: inserted_mod_ban_from_community.id,
776 community_id: inserted_community.id,
777 mod_person_id: inserted_mod.id,
778 other_person_id: inserted_person.id,
782 when_: inserted_mod_ban_from_community.when_,
787 let mod_ban_form = ModBanForm {
788 mod_person_id: inserted_mod.id,
789 other_person_id: inserted_person.id,
794 let inserted_mod_ban = ModBan::create(pool, &mod_ban_form).await.unwrap();
795 let read_mod_ban = ModBan::read(pool, inserted_mod_ban.id).await.unwrap();
796 let expected_mod_ban = ModBan {
797 id: inserted_mod_ban.id,
798 mod_person_id: inserted_mod.id,
799 other_person_id: inserted_person.id,
803 when_: inserted_mod_ban.when_,
808 let mod_add_community_form = ModAddCommunityForm {
809 mod_person_id: inserted_mod.id,
810 other_person_id: inserted_person.id,
811 community_id: inserted_community.id,
814 let inserted_mod_add_community = ModAddCommunity::create(pool, &mod_add_community_form)
817 let read_mod_add_community = ModAddCommunity::read(pool, inserted_mod_add_community.id)
820 let expected_mod_add_community = ModAddCommunity {
821 id: inserted_mod_add_community.id,
822 community_id: inserted_community.id,
823 mod_person_id: inserted_mod.id,
824 other_person_id: inserted_person.id,
826 when_: inserted_mod_add_community.when_,
831 let mod_add_form = ModAddForm {
832 mod_person_id: inserted_mod.id,
833 other_person_id: inserted_person.id,
836 let inserted_mod_add = ModAdd::create(pool, &mod_add_form).await.unwrap();
837 let read_mod_add = ModAdd::read(pool, inserted_mod_add.id).await.unwrap();
838 let expected_mod_add = ModAdd {
839 id: inserted_mod_add.id,
840 mod_person_id: inserted_mod.id,
841 other_person_id: inserted_person.id,
843 when_: inserted_mod_add.when_,
846 Comment::delete(pool, inserted_comment.id).await.unwrap();
847 Post::delete(pool, inserted_post.id).await.unwrap();
848 Community::delete(pool, inserted_community.id)
851 Person::delete(pool, inserted_person.id).await.unwrap();
852 Person::delete(pool, inserted_mod.id).await.unwrap();
853 Instance::delete(pool, inserted_instance.id).await.unwrap();
855 assert_eq!(expected_mod_remove_post, read_mod_remove_post);
856 assert_eq!(expected_mod_lock_post, read_mod_lock_post);
857 assert_eq!(expected_mod_feature_post, read_mod_feature_post);
858 assert_eq!(expected_mod_remove_comment, read_mod_remove_comment);
859 assert_eq!(expected_mod_remove_community, read_mod_remove_community);
860 assert_eq!(expected_mod_ban_from_community, read_mod_ban_from_community);
861 assert_eq!(expected_mod_ban, read_mod_ban);
862 assert_eq!(expected_mod_add_community, read_mod_add_community);
863 assert_eq!(expected_mod_add, read_mod_add);