示例#1
0
 def test_約會成功(self):
     cluster.Male(userId=inspect.currentframe().f_code.co_name,
                  status=110).save()
     cluster.Female(userId=inspect.currentframe().f_code.co_name + "G",
                    status=110).save()
     cluster.Date(femaleId=inspect.currentframe().f_code.co_name + "G",
                  maleId=inspect.currentframe().f_code.co_name,
                  status=40).save()
     dict = {}
     self.messageRequestDict(dict, "我出發了",
                             inspect.currentframe().f_code.co_name)
     response = self.client.post('/', json=dict)
     self.assertEqual(response.status_code, 200)
     self.assertEqual(response.data.decode("utf-8"), "祝您約會順利")
     t_date = cluster.Member.getDate(inspect.currentframe().f_code.co_name)
     self.assertEqual(t_date.status, 50)
     t_memeber = cluster.Member.getUser(
         inspect.currentframe().f_code.co_name)
     self.assertEqual(t_memeber.status, 100)
     t_memeber.delete()
     t_memeber = cluster.Member.getUser(
         inspect.currentframe().f_code.co_name + "G")
     self.assertEqual(t_memeber.status, 100)
     t_memeber.delete()
     t_date.delete()
示例#2
0
 def test_選擇約會對象(self):
     t_member1 = cluster.Female(
         userId=inspect.currentframe().f_code.co_name, status=110).save()
     t_member2 = cluster.Male(userId=inspect.currentframe().f_code.co_name +
                              "M",
                              status=110).save()
     cluster.Date(femaleId=inspect.currentframe().f_code.co_name,
                  invList=[inspect.currentframe().f_code.co_name + "M"],
                  status=11).save()
     dict = {}
     self.postBackRequestDict(dict,
                              inspect.currentframe().f_code.co_name + "M",
                              inspect.currentframe().f_code.co_name)
     response = self.client.post('/', json=dict)
     self.assertEqual(response.status_code, 200)
     self.assertEqual(response.data.decode("utf-8"), "開放 12hr 聊天")
     t_date = cluster.Member.getDate(inspect.currentframe().f_code.co_name)
     self.assertEqual(t_date.status, 20)
     self.assertEqual(t_date.maleId,
                      inspect.currentframe().f_code.co_name + "M")
     self.assertNotIn(inspect.currentframe().f_code.co_name + "M",
                      t_date.invList)
     t_date.delete()
     t_member1.delete()
     t_member2.delete()
示例#3
0
 def test_照片confirm(self):
     cluster.Male(userId=inspect.currentframe().f_code.co_name,
                  status=14).save()
     dict = {}
     self.messageRequestDict(dict, "確認",
                             inspect.currentframe().f_code.co_name)
     response = self.client.post('/', json=dict)
     self.assertEqual(response.status_code, 200)
     self.assertEqual(response.data.decode("utf-8"), "待審核後就可以開始使用了")
     t_memeber = cluster.Member.getUser(
         inspect.currentframe().f_code.co_name)
     self.assertEqual(t_memeber.status, 15)
     t_memeber.delete()
示例#4
0
 def test_教學框(self):
     cluster.Male(userId=inspect.currentframe().f_code.co_name,
                  status=3).save()
     dict = {}
     self.messageRequestDict(dict, "好",
                             inspect.currentframe().f_code.co_name)
     response = self.client.post('/', json=dict)
     self.assertEqual(response.status_code, 200)
     self.assertEqual(response.data.decode("utf-8"), "請輸入<名字>")
     t_memeber = cluster.Member.getUser(
         inspect.currentframe().f_code.co_name)
     self.assertEqual(t_memeber.status, 4)
     t_memeber.delete()
示例#5
0
 def test_生日confirm不是(self):
     cluster.Male(userId=inspect.currentframe().f_code.co_name,
                  status=6,
                  birthDate=date.fromisoformat("1111-11-11")).save()
     dict = {}
     self.messageRequestDict(dict, "不是",
                             inspect.currentframe().f_code.co_name)
     response = self.client.post('/', json=dict)
     self.assertEqual(response.status_code, 200)
     t_memeber = cluster.Member.getUser(
         inspect.currentframe().f_code.co_name)
     self.assertEqual(t_memeber.status, 5)
     self.assertIsNone(t_memeber.birthDate)
     t_memeber.delete()
示例#6
0
 def test_一項個人特質偵測不到標記(self):
     cluster.Male(userId=inspect.currentframe().f_code.co_name,
                  status=7).save()
     personality = "沒標記的個性"
     dict = {}
     self.messageRequestDict(dict, personality,
                             inspect.currentframe().f_code.co_name)
     response = self.client.post('/', json=dict)
     self.assertEqual(response.status_code, 200)
     self.assertEqual(response.data.decode("utf-8"), "偵測不到<>,請再試一次")
     t_memeber = cluster.Member.getUser(
         inspect.currentframe().f_code.co_name)
     self.assertEqual(t_memeber.status, 7)
     self.assertIsNone(t_memeber.personality)
     t_memeber.delete()
示例#7
0
 def test_名字(self):
     cluster.Male(userId=inspect.currentframe().f_code.co_name,
                  status=4).save()
     nickName = "阿蟲"
     dict = {}
     self.messageRequestDict(dict, "<" + nickName + ">",
                             inspect.currentframe().f_code.co_name)
     response = self.client.post('/', json=dict)
     self.assertEqual(response.status_code, 200)
     self.assertEqual(response.data.decode("utf-8"), "請輸入<生日> (yyyy-mm-dd)")
     t_memeber = cluster.Member.getUser(
         inspect.currentframe().f_code.co_name)
     self.assertEqual(t_memeber.status, 5)
     self.assertEqual(t_memeber.nickName, nickName)
     t_memeber.delete()
示例#8
0
 def test_電話找不到標記(self):
     cluster.Male(userId=inspect.currentframe().f_code.co_name,
                  status=12).save()
     phone = "電話沒有標記"
     dict = {}
     self.messageRequestDict(dict, phone,
                             inspect.currentframe().f_code.co_name)
     response = self.client.post('/', json=dict)
     self.assertEqual(response.status_code, 200)
     self.assertEqual(response.data.decode("utf-8"), "偵測不到<>,請再試一次")
     t_memeber = cluster.Member.getUser(
         inspect.currentframe().f_code.co_name)
     self.assertEqual(t_memeber.status, 12)
     self.assertIsNone(t_memeber.phone)
     t_memeber.delete()
示例#9
0
 def test_信箱找不到標記(self):
     cluster.Male(userId=inspect.currentframe().f_code.co_name,
                  status=11).save()
     email = "我沒有標記@gmail.com"
     dict = {}
     self.messageRequestDict(dict, email,
                             inspect.currentframe().f_code.co_name)
     response = self.client.post('/', json=dict)
     self.assertEqual(response.status_code, 200)
     self.assertEqual(response.data.decode("utf-8"), "偵測不到<>,請再試一次")
     t_memeber = cluster.Member.getUser(
         inspect.currentframe().f_code.co_name)
     self.assertEqual(t_memeber.status, 11)
     self.assertIsNone(t_memeber.email)
     t_memeber.delete()
示例#10
0
 def test_職業(self):
     cluster.Male(userId=inspect.currentframe().f_code.co_name,
                  status=9).save()
     job = "工程師"
     dict = {}
     self.messageRequestDict(dict, "<" + job + ">",
                             inspect.currentframe().f_code.co_name)
     response = self.client.post('/', json=dict)
     self.assertEqual(response.status_code, 200)
     self.assertEqual(response.data.decode("utf-8"), "請輸入<照片url>")
     t_memeber = cluster.Member.getUser(
         inspect.currentframe().f_code.co_name)
     self.assertEqual(t_memeber.status, 10)
     self.assertEqual(t_memeber.job, job)
     t_memeber.delete()
示例#11
0
 def test_照片(self):
     cluster.Male(userId=inspect.currentframe().f_code.co_name,
                  status=10).save()
     pictUri = "https://i.imgur.com/aVyjw87"
     dict = {}
     self.messageRequestDict(dict, "<" + pictUri + ">",
                             inspect.currentframe().f_code.co_name)
     response = self.client.post('/', json=dict)
     self.assertEqual(response.status_code, 200)
     self.assertEqual(response.data.decode("utf-8"), "請輸入<信箱>")
     t_memeber = cluster.Member.getUser(
         inspect.currentframe().f_code.co_name)
     self.assertEqual(t_memeber.status, 11)
     self.assertEqual(t_memeber.pictUri, pictUri)
     t_memeber.delete()
示例#12
0
 def test_輸入錯誤的驗證碼(self):
     cluster.Male(userId=inspect.currentframe().f_code.co_name,
                  status=13).save()
     validateCode = "錯誤密碼"
     dict = {}
     self.messageRequestDict(dict, validateCode,
                             inspect.currentframe().f_code.co_name)
     response = self.client.post('/', json=dict)
     self.assertEqual(response.status_code, 200)
     self.assertEqual(response.data.decode("utf-8"), "錯誤,請再輸入一次手機")
     t_memeber = cluster.Member.getUser(
         inspect.currentframe().f_code.co_name)
     self.assertEqual(t_memeber.status, 12)
     self.assertIsNone(t_memeber.phone)
     t_memeber.delete()
示例#13
0
 def test_興趣10word(self):
     cluster.Male(userId=inspect.currentframe().f_code.co_name,
                  status=8).save()
     hobit = "釣魚"
     dict = {}
     self.messageRequestDict(dict, "<" + hobit + ">",
                             inspect.currentframe().f_code.co_name)
     response = self.client.post('/', json=dict)
     self.assertEqual(response.status_code, 200)
     self.assertEqual(response.data.decode("utf-8"), "請輸入<職業>")
     t_memeber = cluster.Member.getUser(
         inspect.currentframe().f_code.co_name)
     self.assertEqual(t_memeber.status, 9)
     self.assertEqual(t_memeber.hobit, hobit)
     t_memeber.delete()
示例#14
0
 def test_一項個人特質(self):
     cluster.Male(userId=inspect.currentframe().f_code.co_name,
                  status=7).save()
     personality = "懶惰"
     dict = {}
     self.messageRequestDict(dict, "<" + personality + ">",
                             inspect.currentframe().f_code.co_name)
     response = self.client.post('/', json=dict)
     self.assertEqual(response.status_code, 200)
     self.assertEqual(response.data.decode("utf-8"), "請輸入<興趣>")
     t_memeber = cluster.Member.getUser(
         inspect.currentframe().f_code.co_name)
     self.assertEqual(t_memeber.status, 8)
     self.assertEqual(t_memeber.personality, personality)
     t_memeber.delete()
示例#15
0
 def test_生日(self):
     cluster.Male(userId=inspect.currentframe().f_code.co_name,
                  status=5).save()
     birthdate = "1995-03-25"
     dict = {}
     self.messageRequestDict(dict, "<" + birthdate + ">",
                             inspect.currentframe().f_code.co_name)
     response = self.client.post('/', json=dict)
     self.assertEqual(response.status_code, 200)
     self.assertEqual(response.data.decode("utf-8"), "您是1995-03-25的牡羊座男孩嗎?")
     t_memeber = cluster.Member.getUser(
         inspect.currentframe().f_code.co_name)
     self.assertEqual(t_memeber.status, 6)
     self.assertEqual(t_memeber.birthDate.isoformat(), birthdate)
     t_memeber.delete()
示例#16
0
 def test_電話(self):
     cluster.Male(userId=inspect.currentframe().f_code.co_name,
                  status=12).save()
     phone = "0919547381"
     dict = {}
     self.messageRequestDict(dict, "<" + phone + ">",
                             inspect.currentframe().f_code.co_name)
     response = self.client.post('/', json=dict)
     self.assertEqual(response.status_code, 200)
     self.assertEqual(response.data.decode("utf-8"), "請輸入<驗證碼>,查看手機簡訊")
     t_memeber = cluster.Member.getUser(
         inspect.currentframe().f_code.co_name)
     self.assertEqual(t_memeber.status, 13)
     self.assertEqual(t_memeber.phone, phone)
     t_memeber.delete()
示例#17
0
 def test_信箱(self):
     cluster.Male(userId=inspect.currentframe().f_code.co_name,
                  status=11).save()
     email = "*****@*****.**"
     dict = {}
     self.messageRequestDict(dict, "<" + email + ">",
                             inspect.currentframe().f_code.co_name)
     response = self.client.post('/', json=dict)
     self.assertEqual(response.status_code, 200)
     self.assertEqual(response.data.decode("utf-8"), "請輸入<電話>")
     t_memeber = cluster.Member.getUser(
         inspect.currentframe().f_code.co_name)
     self.assertEqual(t_memeber.status, 12)
     self.assertEqual(t_memeber.email, email)
     t_memeber.delete()
示例#18
0
 def test_討論好餐廳和時間了(self):
     t_member = cluster.Male(userId=inspect.currentframe().f_code.co_name,
                             status=110).save()
     cluster.Date(femaleId=inspect.currentframe().f_code.co_name + "G",
                  maleId=inspect.currentframe().f_code.co_name,
                  status=20).save()
     dict = {}
     self.messageRequestDict(dict, "討論好餐廳和時間了",
                             inspect.currentframe().f_code.co_name)
     response = self.client.post('/', json=dict)
     self.assertEqual(response.status_code, 200)
     self.assertEqual(response.data.decode("utf-8"), "請輸入<inLIne定位資訊>")
     t_date = cluster.Member.getDate(inspect.currentframe().f_code.co_name)
     self.assertEqual(t_date.status, 21)
     t_date.delete()
     t_member.delete()
示例#19
0
 def test_聊天1(self):
     t_member = cluster.Male(userId=inspect.currentframe().f_code.co_name,
                             status=110).save()
     t_date = cluster.Date(femaleId=inspect.currentframe().f_code.co_name +
                           "G",
                           maleId=inspect.currentframe().f_code.co_name,
                           status=20).save()
     dict = {}
     self.messageRequestDict(dict, "午安啊~",
                             inspect.currentframe().f_code.co_name)
     response = self.client.post('/', json=dict)
     self.assertEqual(response.status_code, 200)
     t_date = cluster.Member.getDate(inspect.currentframe().f_code.co_name +
                                     "G")
     self.assertEqual(t_date.status, 20)
     t_date.delete()
     t_member.delete()
示例#20
0
 def test_輸入驗證碼(self):
     cluster.Male(userId=inspect.currentframe().f_code.co_name,
                  status=13,
                  nickName="阿諺",
                  personality="開朗",
                  hobit="做愛",
                  pictUri="https://i.imgur.com/9FEddMc.jpg",
                  birthDate="1999-03-22").save()
     validateCode = "iampassword"
     dict = {}
     self.messageRequestDict(dict, validateCode,
                             inspect.currentframe().f_code.co_name)
     response = self.client.post('/', json=dict)
     self.assertEqual(response.status_code, 200)
     self.assertEqual(response.data.decode("utf-8"), "最後確認,這樣資料正確嗎?")
     t_memeber = cluster.Member.getUser(
         inspect.currentframe().f_code.co_name)
     self.assertEqual(t_memeber.status, 14)
     t_memeber.delete()
示例#21
0
 def test_約她(self):
     cluster.Male(userId=inspect.currentframe().f_code.co_name,
                  status=100).save()
     cluster.Date(femaleId=inspect.currentframe().f_code.co_name + "G",
                  status=10).save()
     dict = {}
     self.postBackRequestDict(dict,
                              inspect.currentframe().f_code.co_name + "G",
                              inspect.currentframe().f_code.co_name)
     response = self.client.post('/', json=dict)
     self.assertEqual(response.status_code, 200)
     self.assertEqual(response.data.decode("utf-8"), "成功邀約,對象會在24小時內回覆")
     t_memeber = cluster.Member.getUser(
         inspect.currentframe().f_code.co_name)
     self.assertEqual(t_memeber.status, 110)
     t_memeber.delete()
     t_date = cluster.Member.getDate(inspect.currentframe().f_code.co_name +
                                     "G")
     self.assertIn(inspect.currentframe().f_code.co_name, t_date.invList)
     self.assertEqual(t_date.status, 11)
     t_date.delete()
示例#22
0
 def test_有人約(self):
     t_member1 = cluster.Female(
         userId=inspect.currentframe().f_code.co_name, status=110).save()
     t_member2 = cluster.Male(userId=inspect.currentframe().f_code.co_name +
                              "M",
                              status=110).save()
     cluster.Date(femaleId=inspect.currentframe().f_code.co_name,
                  status=11,
                  invList=[inspect.currentframe().f_code.co_name + "M"
                           ]).save()
     dict = {}
     self.messageRequestDict(dict, "隨便輸入訊息",
                             inspect.currentframe().f_code.co_name)
     response = self.client.post('/', json=dict)
     self.assertEqual(response.status_code, 200)
     self.assertEqual(response.data.decode("utf-8"), "有人邀約了")
     t_date = cluster.Member.getDate(inspect.currentframe().f_code.co_name)
     self.assertEqual(t_date.status, 11)
     t_date.delete()
     t_member1.delete()
     t_member2.delete()
示例#23
0
 def test_敲定時間地點(self):
     t_member = cluster.Male(userId=inspect.currentframe().f_code.co_name,
                             status=110).save()
     cluster.Date(femaleId=inspect.currentframe().f_code.co_name + "G",
                  maleId=inspect.currentframe().f_code.co_name,
                  status=21).save()
     dict = {}
     self.messageRequestDict(
         dict,
         "<" + "https://inline.app/reservations/-MYykIBSxYNLzWg4ZgtI" + ">",
         inspect.currentframe().f_code.co_name)
     response = self.client.post('/', json=dict)
     self.assertEqual(response.status_code, 200)
     self.assertEqual(response.data.decode("utf-8"), "關閉聊天,約會前12hr會開啟")
     t_date = cluster.Member.getDate(inspect.currentframe().f_code.co_name)
     self.assertEqual(
         t_date.inlineRes,
         "https://inline.app/reservations/-MYykIBSxYNLzWg4ZgtI")
     self.assertEqual(t_date.status, 30)
     t_date.delete()
     t_member.delete()
示例#24
0
def webhook():
    client = LineBotApi(os.environ['lineKey'])
    rJson = request.json["events"]
    if not rJson:
        return ""
    eventType: Final = rJson[0]["type"]
    if eventType not in ["postback", "message"]:
        return
    userId: Final = rJson[0]["source"]["userId"]
    user = cluster.Member.getUser(userId)
    token: Final = rJson[0]["replyToken"]
    replyT = ""
    if eventType == "postback":
        status = user.status
        if status == 100:
            """event 男生發出邀約"""
            reqsT: Final = rJson[0]["postback"]["data"]
            user.status += 10
            user.save()
            date = cluster.Member.getDate(reqsT)
            date.assignValue(reqsT=userId,
                             userId=userId,
                             token=token,
                             client=client)
            replyT = date.replyText(reqsT=userId,
                                    userId=userId,
                                    token=token,
                                    client=client)
            date.statusChange(reqsT=userId)
            # push message to girl
            if token != userId:
                client.push_message(reqsT, TextSendMessage(text='收到邀約囉'))
        elif status == 110:
            """女生選擇約會對象"""
            reqsT: Final = rJson[0]["postback"]["data"]
            date = cluster.Member.getDate(userId)
            date.assignValue(reqsT=reqsT,
                             userId=userId,
                             token=token,
                             client=client)
            replyT = date.replyText(reqsT=reqsT,
                                    userId=userId,
                                    token=token,
                                    client=client)
            date.statusChange(reqsT=reqsT)
            # push message to man
            if token != userId:
                client.push_message(reqsT, TextSendMessage(text='配對成功囉,開始聊天'))
        return replyT

    # status 1 ~ 2
    reqsT: Final = rJson[0]["message"]["text"]
    if not user:
        if reqsT in ["開始使用", "去註冊約她"]:
            replyT = "請輸入性別"
            action1 = actions.MessageAction(text="男生", label="男生")
            action2 = actions.MessageAction(text="女生", label="女生")
            column = template.CarouselColumn(text=replyT,
                                             actions=[action1, action2])
            carouse = template.CarouselTemplate(columns=[column])
            if token != userId:
                client.reply_message(token, [
                    template.TemplateSendMessage(template=carouse,
                                                 alt_text="broke")
                ])
            return replyT
        elif reqsT == "預覽約會":
            replyT = "本週約會有"
            action = actions.MessageAction(text="去註冊約她", label="去註冊約她")
            columnL = []
            for girl in cluster.Female.objects(status__gte=15):
                column = template.CarouselColumn(
                    title=girl.nickName,
                    text=girl.introT(),
                    thumbnail_image_url=girl.pictUri,
                    actions=[action])
                if len(columnL) == 10:
                    break
                else:
                    columnL.append(column)
            carouse = template.CarouselTemplate(columns=columnL)
            if token != userId:
                client.reply_message(token, [
                    TextSendMessage(text=replyT),
                    template.TemplateSendMessage(template=carouse,
                                                 alt_text="broke")
                ])
            return replyT
        elif reqsT in ["男生", "男"]:
            cluster.Male(userId=userId, status=3).save()
            replyT = "注意:需用<>標記訊息"
        elif reqsT in ["女生", "女"]:
            cluster.Female(status=3, userId=userId).save()
            replyT = "注意:需用<>標記訊息"
        elif reqsT in ["測試帳號男"]:
            ming = cluster.Male.objects(nickName="小明", phone="test123")[0]
            ming.userId = userId
            ming.save()
            replyT = "設置完成"
        elif reqsT in ["測試帳號女"]:
            mei = cluster.Female.objects(nickName="小美", phone="test123")[0]
            mei.userId = userId
            mei.save()
            replyT = "設置完成"
        elif reqsT == "快速使用(測試用)":
            replyT = "選擇性別"
            action1 = actions.MessageAction(text="測試帳號男", label="測試帳號男")
            action2 = actions.MessageAction(text="測試帳號女", label="測試帳號女")
            column = template.CarouselColumn(text=replyT,
                                             actions=[action1, action2])
            carouse = template.CarouselTemplate(columns=[column])
            if token != userId:
                client.reply_message(token, [
                    template.TemplateSendMessage(template=carouse,
                                                 alt_text="broke")
                ])
            return replyT
        else:
            replyT = "歡迎"
            action1 = actions.MessageAction(text="開始使用", label="開始使用")
            action2 = actions.MessageAction(text="預覽約會", label="預覽約會")
            action3 = actions.MessageAction(text="快速使用(測試用)",
                                            label="快速使用(測試用)")
            column = template.CarouselColumn(
                text=replyT, actions=[action1, action2, action3])
            carouse = template.CarouselTemplate(columns=[column])
            if token != userId:
                client.reply_message(token, [
                    template.TemplateSendMessage(template=carouse,
                                                 alt_text="broke")
                ])
            return replyT
        if token != userId:
            client.reply_message(token, TextSendMessage(text=replyT))
        return replyT
    status = user.status
    # status 3 ~ 14
    if status in range(3, 15):
        replyT = user.signup(reqsT=reqsT, client=client, token=token)

    elif status == 100:
        if reqsT == "發起約會" and not user.isMale():
            replyT = user.createDate()
        elif reqsT == "觀看約會" and user.isMale():
            user.readDate(token=token, userId=userId, client=client)
            return
        elif reqsT == "我的交友名片":
            replyT = "我的交友名片"
            action = actions.MessageAction(text='好', label='好')
            column = template.CarouselColumn(title=user.nickName,
                                             text=user.introT(),
                                             thumbnail_image_url=user.pictUri,
                                             actions=[action])
            carouse = template.CarouselTemplate(columns=[column])
            sendMsg = [
                TextSendMessage(text=replyT),
                template.TemplateSendMessage(template=carouse,
                                             alt_text="break")
            ]
            if token != userId:
                client.reply_message(token, sendMsg)
            return
        else:
            replyT = "歡迎"
            action = ""
            if user.isMale():
                action = actions.MessageAction(text="觀看約會", label="觀看約會")
            else:
                action = actions.MessageAction(text="發起約會", label="發起約會")
            action2 = actions.MessageAction(text="我的交友名片", label="我的交友名片")
            column = template.CarouselColumn(text=replyT,
                                             actions=[action, action2])
            carouse = template.CarouselTemplate(columns=[column])
            if token != userId:
                client.reply_message(token, [
                    template.TemplateSendMessage(template=carouse,
                                                 alt_text="broke")
                ])
            return replyT
    elif status == 110:
        date = cluster.Member.getDate(userId)
        if reqsT == "觀看邀請名單" and not user.isMale():
            user.readInvList(token=token, userId=userId, client=client)
            return ""
        date.assignValue(reqsT=reqsT,
                         userId=userId,
                         token=token,
                         client=client)
        replyT = date.replyText(reqsT=reqsT,
                                userId=userId,
                                token=token,
                                client=client)
        date.statusChange(reqsT=reqsT)
        return replyT
    if token != userId:
        client.reply_message(token, TextSendMessage(text=replyT))
    return replyT
示例#25
0
 def test_get_userMale(self):
     tar = cluster.Male(userId="123").save()
     result = cluster.Member.getUser("123")
     self.assertTrue(result)
     tar.delete()