]> Untitled Git - lemmy.git/commitdiff
Fixing nsfw unit tests
authorDessalines <tyhou13@gmx.com>
Wed, 14 Aug 2019 03:15:52 +0000 (20:15 -0700)
committerDessalines <tyhou13@gmx.com>
Wed, 14 Aug 2019 03:15:52 +0000 (20:15 -0700)
server/src/apub.rs
server/src/db/comment.rs
server/src/db/comment_view.rs
server/src/db/community.rs
server/src/db/moderator.rs
server/src/db/post.rs
server/src/db/post_view.rs

index 23735e63f1e215a92cc0d9eba56b76b7e6fde555..9de32401d722d433bcc94b1c28b81833db19cb2a 100644 (file)
@@ -46,7 +46,8 @@ mod tests {
       published: naive_now(),
       admin: false,
       banned: false,
-      updated: None
+      updated: None,
+      show_nsfw: false,
     };
 
     let person = expected_user.person();
index d125124ce4c81ea7058a22abc168960236120117..ce0b5a632a253e8fec48103e5f7537cc495a77af 100644 (file)
@@ -170,7 +170,8 @@ mod tests {
       email: None,
       admin: false,
       banned: false,
-      updated: None
+      updated: None,
+      show_nsfw: false,
     };
 
     let inserted_user = User_::create(&conn, &new_user).unwrap();
@@ -183,7 +184,8 @@ mod tests {
       creator_id: inserted_user.id,
       removed: None,
       deleted: None,
-      updated: None
+      updated: None,
+      nsfw: false,
     };
 
     let inserted_community = Community::create(&conn, &new_community).unwrap();
@@ -197,7 +199,8 @@ mod tests {
       removed: None,
       deleted: None,
       locked: None,
-      updated: None
+      updated: None,
+      nsfw: false,
     };
 
     let inserted_post = Post::create(&conn, &new_post).unwrap();
index 53517db958f0d037a571a015f2d33c8843c27c22..8a6545ba23bb93244aa2e9ccd442a843f3744ca5 100644 (file)
@@ -261,7 +261,8 @@ mod tests {
       email: None,
       admin: false,
       banned: false,
-      updated: None
+      updated: None,
+      show_nsfw: false,
     };
 
     let inserted_user = User_::create(&conn, &new_user).unwrap();
@@ -274,7 +275,8 @@ mod tests {
       creator_id: inserted_user.id,
       removed: None,
       deleted: None,
-      updated: None
+      updated: None,
+      nsfw: false,
     };
 
     let inserted_community = Community::create(&conn, &new_community).unwrap();
@@ -288,7 +290,8 @@ mod tests {
       removed: None,
       deleted: None,
       locked: None,
-      updated: None
+      updated: None,
+      nsfw: false,
     };
 
     let inserted_post = Post::create(&conn, &new_post).unwrap();
index aa28c9c735c9f2b686d5eafb1494ac8f16c35af4..dd6ea94b0171f306bc6cb2175d3c63e5ee20e4e2 100644 (file)
@@ -231,7 +231,8 @@ mod tests {
       email: None,
       admin: false,
       banned: false,
-      updated: None
+      updated: None,
+      show_nsfw: false,
     };
 
     let inserted_user = User_::create(&conn, &new_user).unwrap();
index 56cf2f4719b6ff24d67f78a1f598e65b9dfda6a5..fec46aa18d6933da8d9c79aa7f11af6158ced987 100644 (file)
@@ -412,7 +412,8 @@ mod tests {
       email: None,
       admin: false,
       banned: false,
-      updated: None
+      updated: None,
+      show_nsfw: false,
     };
 
     let inserted_mod = User_::create(&conn, &new_mod).unwrap();
@@ -425,7 +426,8 @@ mod tests {
       email: None,
       admin: false,
       banned: false,
-      updated: None
+      updated: None,
+      show_nsfw: false,
     };
 
     let inserted_user = User_::create(&conn, &new_user).unwrap();
@@ -438,7 +440,8 @@ mod tests {
       creator_id: inserted_user.id,
       removed: None,
       deleted: None,
-      updated: None
+      updated: None,
+      nsfw: false,
     };
 
     let inserted_community = Community::create(&conn, &new_community).unwrap();
@@ -452,7 +455,8 @@ mod tests {
       removed: None,
       deleted: None,
       locked: None,
-      updated: None
+      updated: None,
+      nsfw: false,
     };
 
     let inserted_post = Post::create(&conn, &new_post).unwrap();
index 6a8bf26dde411738fa24d3ed9f371a2ccbd9a1f8..12ea10818150db46d26bf376b08e8210e34cad78 100644 (file)
@@ -185,7 +185,8 @@ mod tests {
       email: None,
       admin: false,
       banned: false,
-      updated: None
+      updated: None,
+      show_nsfw: false,
     };
 
     let inserted_user = User_::create(&conn, &new_user).unwrap();
@@ -198,7 +199,8 @@ mod tests {
       creator_id: inserted_user.id,
       removed: None,
       deleted: None,
-      updated: None
+      updated: None,
+      nsfw: false,
     };
 
     let inserted_community = Community::create(&conn, &new_community).unwrap();
index 736862665b30ad3e5b397cbafd3ed1a07b3ff20a..c7e6eea3e56e4c5f1528db3bbf05c23f4d5d18ad 100644 (file)
@@ -208,6 +208,7 @@ mod tests {
       updated: None,
       admin: false,
       banned: false,
+      show_nsfw: false,
     };
 
     let inserted_user = User_::create(&conn, &new_user).unwrap();
@@ -220,7 +221,8 @@ mod tests {
       category_id: 1,
       removed: None,
       deleted: None,
-      updated: None
+      updated: None,
+      nsfw: false,
     };
 
     let inserted_community = Community::create(&conn, &new_community).unwrap();
@@ -234,7 +236,8 @@ mod tests {
       removed: None,
       deleted: None,
       locked: None,
-      updated: None
+      updated: None,
+      nsfw: false,
     };
 
     let inserted_post = Post::create(&conn, &new_post).unwrap();
@@ -289,6 +292,7 @@ mod tests {
       subscribed: None,
       read: None,
       saved: None,
+      nsfw: false,
     };
 
     let expected_post_listing_with_user = PostView {
@@ -318,6 +322,7 @@ mod tests {
       subscribed: None,
       read: None,
       saved: None,
+      nsfw: false,
     };
 
 
@@ -327,6 +332,7 @@ mod tests {
                                                       None, 
                                                       None,
                                                       Some(inserted_user.id), 
+                                                      false,
                                                       false, 
                                                       false, 
                                                       None, 
@@ -338,6 +344,7 @@ mod tests {
                                                     None, 
                                                     None, 
                                                     None,
+                                                    false,
                                                     false, 
                                                     false, 
                                                     None,