         }
     }
     
+    func testFriendshipBlockAndUnblockAndQuery() {
+        let user_1 = LCUser()
+        expecting { exp in
+            user_1.login(withAuthData: ["openid": uuid], platformId: "test", options: nil) { succeeded, error in
+                XCTAssertTrue(succeeded)
+                XCTAssertNil(error)
+                exp.fulfill()
+            }
+        }
+        
+        guard
+            let _ = user_1.objectId,
+            LCUser.current() === user_1
+        else {
+            XCTFail()
+            return
+        }
+        
+        LCUser.logOut()
+        
+        let user_2 = LCUser()
+        expecting { exp in
+            user_2.login(withAuthData: ["openid": uuid], platformId: "test", options: nil) { succeeded, error in
+                XCTAssertTrue(succeeded)
+                XCTAssertNil(error)
+                exp.fulfill()
+            }
+        }
+        
+        guard
+            let _ = user_2.objectId,
+            LCUser.current() === user_2
+        else {
+            XCTFail()
+            return
+        }
+        
+        expecting { exp in
+            LCFriendship.request(withUserId: user_1.objectId!, attributes: ["group": "sport"]) { succeeded, error in
+                XCTAssertTrue(succeeded)
+                XCTAssertNil(error)
+                exp.fulfill()
+            }
+        }
+        
+        LCUser.changeCurrentUser(user_1, save: false)
+        
+        var query: LCQuery!
+        expecting(description: "Accept Friendship Request", count: 2) { exp in
+            query = LCFriendshipRequest.query()
+            query.findObjectsInBackground { requests, error in
+                let request = requests?.first as? LCFriendshipRequest
+                let friend = request?["friend"] as? LCUser
+                let user = request?["user"] as? LCUser
+                XCTAssertNotNil(request)
+                XCTAssertNotNil(friend)
+                XCTAssertNotNil(user)
+                XCTAssertNil(error)
+                exp.fulfill()
+                if let request = request {
+                    LCFriendship.accept(request, attributes: ["group": "music"]) { succeeded, error in
+                        XCTAssertTrue(succeeded)
+                        XCTAssertNil(error)
+                        exp.fulfill()
+                    }
+                }
+            }
+        }
+        
+        expecting { exp in
+            query = user_1.friendshipQuery()
+            query.includeKey("followee")
+            query.findObjectsInBackground { followees, error in
+                let first = followees?.first as? LCObject
+                let followee = first?["followee"] as? LCObject
+                XCTAssertNotNil(followee)
+                XCTAssertNotNil(followee?["username"] as? String)
+                XCTAssertEqual(first?["group"] as? String, "music")
+                XCTAssertNil(error)
+                exp.fulfill()
+            }
+        }
+        
+        expecting { exp in
+            LCFriendship.blockFriend(withUserId: user_2.objectId!) { succeeded, error in
+                XCTAssertTrue(succeeded)
+                XCTAssertNil(error)
+                exp.fulfill()
+            }
+        }
+        
+        expecting { exp in
+            query = user_1.friendshipBlockQuery()
+            query.includeKey("blockedUser")
+            query.findObjectsInBackground { blockedUsers, error in
+                let first = blockedUsers?.first as? LCObject
+                let blockedUser = first?["blockedUser"] as? LCObject
+                XCTAssertNotNil(blockedUser)
+                XCTAssertNotNil(blockedUser?["username"] as? String)
+                XCTAssertNil(error)
+                exp.fulfill()
+            }
+        }
+        
+        expecting { exp in
+            LCFriendship.unblockFriend(withUserId: user_2.objectId!) { succeeded, error in
+                XCTAssertTrue(succeeded)
+                XCTAssertNil(error)
+                exp.fulfill()
+            }
+        }
+    }
+    
     func testStrictlyFind() {
         expecting { exp in
             LCUser.loginAnonymously { user, error in

            }
        }
        
        guard let _ = user_2.objectId,
              LCUser.current() === user_2 else {
            XCTFail()
            return
        }

            }
        }
        
        guard
            let _ = user_1.objectId,
            LCUser.current() === user_1
        else {
            XCTFail()
            return
        }
        
        LCUser.logOut()
        
        let user_2 = LCUser()
