Beispiel #1
0
    def test_get_involved_group(self):
        user1 = '18868103391'
        user2 = '17862710056'
        scope = 'H'
        relation = '姐姐'

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

        scope_list = get_all_join_scope(user1)
        self.assertEqual(len(scope_list), 4)

        scope_list = get_all_join_scope(user2)
        self.assertEqual(len(scope_list), 4)
Beispiel #2
0
def get_all_invole_scope(request, name):
    """
    Gets all involved scopes. Including the initial three scopes and
    other involved groups.
    """
    try:
        _id_list = get_all_join_scope(name)
        return Response({"id": _id_list})
    except Exception as e:
        print e
        return Response(status=status.HTTP_404_NOT_FOUND)