def test_blob_model(): email = '*****@*****.**' blob = Blob() assert len(blob.uid) > 0 assert blob.email == '' blob.email = email blob.save() content = blob.to_json() assert content['email'] == email __blob_model(blob, email)
def create(request): form = CollectorForm(request.POST) if not form.is_valid(): return HttpResponse(status=400) data = form.cleaned_data blob = Blob() blob.email = data["collectorEmail"] blob.save() send_email(request, blob) return JSONResponse201(blob.to_json())