title: django 2.2.21 file path
body: <p>since django did this security issue</p>
  <p><a href="https://www.djangoproject.com/weblog/2021/may/04/security-releases/" rel="nofollow noreferrer">https://www.djangoproject.com/weblog/2021/may/04/security-releases/</a></p>
  <p>iam not able to open file for test data:
  iam using</p>
  <pre><code>import os
  from django.core.files import File
  file = File(os.path.join(os.path.dirname(__file__), &quot;data&quot;, &quot;tests&quot;, &quot;test_pdf.pdf&quot;))
  </code></pre>
  <p>then</p>
  <pre><code>Model.objects.create(name=&quot;test&quot;. file=file)
  </code></pre>
  <p>getting error:</p>
  <pre><code> django.core.exceptions.SuspiciousFileOperation: File name 'apps/app/data/tests/test_pdf.pdf' includes path elements
  </code></pre>
  <p>any workaroud of this? or whats a correct way to load the pdf?</p>