TypeError when concatenating django.test.LiveServerTestCase's live_server_url with another string

前端 未结 2 412
南方客
南方客 2021-01-22 10:43

Whenever I try to construct a string based on self.live_server_url, I get python TypeError messages. For example, I\'ve tried the fol

相关标签:
2条回答
  • 2021-01-22 11:14

    See this discussion on Reddit featuring the same error Traceback.

    Basically, this is not a problem with anything within the Selenium tests but rather with your project's static file configuration.

    From your question, I believe the key line within the Traceback is:

    File "/usr/local/lib/python3.4/site-packages/django/views/static.py", line 54, in serve
        fullpath = os.path.join(document_root, newpath) 
    

    This line indicates that an unsuccessful os.path.join is being attempted within django.views.static.

    Set STATIC_ROOT in your project's settings.pyfile and you should be good.

    0 讨论(0)
  • 2021-01-22 11:28

    Use StaticLiveServerTestCase instead may help

    0 讨论(0)
提交回复
热议问题