#32626: TypeError while using Selenium with Django 3.2
-------------------------------------+-------------------------------------
               Reporter:  Fabrice    |          Owner:  nobody
  Jaouën                             |
                   Type:  Bug        |         Status:  new
              Component:  Testing    |        Version:  3.2
  framework                          |
               Severity:  Normal     |       Keywords:  Posixpath Selenium
           Triage Stage:             |      Has patch:  0
  Unreviewed                         |
    Needs documentation:  0          |    Needs tests:  0
Patch needs improvement:  0          |  Easy pickings:  0
                  UI/UX:  0          |
-------------------------------------+-------------------------------------
 Hello,
 I'm developing a Django project and a puzzling error has popped up, while
 using Selenium.
 - The Selenium tests run smoothly and pass, despite this error message
 - The unitary tests as well.
 - When I launch the server, the project runs fine, as well...
 Here is the Selenium starting point:
 {{{
 class CustomUserTest(LiveServerTestCase):
     fixtures = ['users.json']

     @classmethod
     def setUpClass(cls):
         super().setUpClass()
         cls.browser = Firefox()
         cls.browser.implicitly_wait(10)

     @classmethod
     def tearDownClass(cls):
         cls.browser.quit()
         super().tearDownClass()

     def test_plaid_10_authenticate_on_the_website(self):
         self.browser.get(os.path.join(self.live_server_url, ''))
 }}}


 There is only a puzzling error message, which does not seem being related
 to my project, as everything else is ok.
 Here is an excerpts of the issue:

 {{{
   File "Users/myname/Documents/myfolder/myproject/venv/lib/python3.7/site-
 packages/django/test/testcases.py", line 1417, in serve
     return serve(request, final_rel_path,
 document_root=self.get_base_dir())
   File "Users/myname/Documents/myfolder/myproject/venv/lib/python3.7/site-
 packages/django/views/static.py", line 36, in serve
     fullpath = Path(safe_join(document_root, path))
   File "Users/myname/Documents/myfolder/myproject/venv/lib/python3.7/site-
 packages/django/utils/_os.py", line 17, in safe_join
     final_path = abspath(join(base, *paths))
   File
 "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/posixpath.py",
 line 80, in join
     a = os.fspath(a)
 TypeError: expected str, bytes or os.PathLike object, not NoneType
 [09/Apr/2021 07:13:07,948] - Broken pipe from ('127.0.0.1', 54981)
 }}}
  Here is a copy of my requirements.txt:
 {{{
 asgiref==3.3.4
 certifi==2020.12.5
 chardet==4.0.0
 coverage==5.5
 Django==3.2
 django-registration-redux==2.9
 idna==2.10
 psycopg2==2.8.6
 python-dotenv==0.15.0
 pytz==2021.1
 requests==2.25.1
 selenium==3.141.0
 sqlparse==0.4.1
 typing-extensions==3.7.4.3
 urllib3==1.26.4
 }}}

 Hope this bug may raise your interest !
 Kind regards.
 Fabrice

-- 
Ticket URL: <https://code.djangoproject.com/ticket/32626>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/053.a0c7673ad74204b1df2439d4098145a3%40djangoproject.com.

Reply via email to