Exemple #1
0
 def setUpTestData(cls):
     serializer = ImportSerializer(data=import_data)
     serializer.is_valid()
     serializer.save()
Exemple #2
0
def import_from_url(request):
    ser = ImportSerializer(data=request.data, context=dict(user=request.user))
    if ser.is_valid(raise_exception=True):
        ser.save()
        return Response(ser.validated_data, status=status.HTTP_201_CREATED)
Exemple #3
0
    def setUpTestData(cls):
        cls.url = reverse('citizen', kwargs={'import_id': 1, 'citizen_id': 1})

        serializer = ImportSerializer(data=import_data)
        serializer.is_valid()
        serializer.save()
Exemple #4
0
def import_list(request):
    serializer = ImportSerializer(data=request.data)
    serializer.is_valid(raise_exception=True)
    import_instance = serializer.save()
    return Response({'data': {'import_id': import_instance.id}}, status=status.HTTP_201_CREATED)