Ejemplo n.º 1
0
    def test_get_home_member(self):
        user1 = '18868103391'
        user2 = '17862710056'
        scope = 'H'
        relation = '姐姐'

        create_relation(user1, user2, relation, 'test')

        update_user_scope(user1, user2, scope, relation)

        user1 = '18868103391'
        user2 = '13375746248'
        scope = 'H'
        relation = '姐姐'

        create_relation(user1, user2, relation, 'test')

        update_user_scope(user1, user2, scope, relation)

        data = get_home_member(user1)
        self.assertIsNotNone(data)

        friends_information = get_friend_information(data)
        print friends_information
        self.assertIsNotNone(friends_information)
Ejemplo n.º 2
0
def home_member_list(request, name):
    """
    Gets one person's home member list.

    data:

        {'home_id': string;
        'data': json
        'status': http status
        }

    """

    try:
        home_member = get_home_member(name)
        data = get_friend_information(home_member)
        home_id = get_home_id(name)
        return Response({"data": data, "home_id": home_id})
    except Exception as e:
        print e
        return Response(status=status.HTTP_404_NOT_FOUND)