def test_member_comparison(): member_dict = { "first_name": "Arthur", "last_name": "Dent", "email": "*****@*****.**", "phone": "912340042", } member_1 = Member.from_dict(member_dict) member_2 = Member.from_dict(member_dict) assert member_1 == member_2
def member(): member_dict = { "first_name": "Arthur", "last_name": "Dent", "email": "*****@*****.**", "phone": "912340042", } return Member.from_dict(member_dict)
def test_member_repr(): member = Member( first_name="Arthur", last_name="Dent", email="*****@*****.**", phone="912340042", ) assert repr(member) == f"<Member: {member.first_name} {member.last_name}>"
def execute(self, request): from asociate.entities.member import Member try: self.repo.add_member(request.association_code, request.member) return ResponseSuccess(value=Member.from_dict(request.member)) except Exception as exc: return ResponseFailure(exc)
def test_member_full_name(): member_dict = { "first_name": "Arthur", "last_name": "Dent", "email": "*****@*****.**", "phone": "912340042", } member = Member.from_dict(member_dict) assert member.full_name == "Arthur Dent"
def members(member): other_member_dict = { "first_name": "Ford", "last_name": "Prefect", "email": "*****@*****.**", "phone": "912340042", } other_member = Member.from_dict(other_member_dict) return [member, other_member]
def test_member_model_to_dict(): member_dict = { "first_name": "Arthur", "last_name": "Dent", "email": "*****@*****.**", "phone": "912340042", "active": False, } member = Member.from_dict(member_dict) assert member.to_dict() == member_dict
def test_member_init(): member = Member( first_name="Arthur", last_name="Dent", email="*****@*****.**", phone="912340042", ) assert member.first_name == "Arthur" assert member.last_name == "Dent" assert member.email == "*****@*****.**" assert member.phone == "912340042"
def test_member_init_from_dict(): member_dict = { "first_name": "Arthur", "last_name": "Dent", "email": "*****@*****.**", "phone": "912340042", } member = Member.from_dict(member_dict) assert member.first_name == "Arthur" assert member.last_name == "Dent" assert member.email == "*****@*****.**" assert member.phone == "912340042"