Code

Opened 2 years ago

Closed 2 years ago

#17807 closed Bug (invalid)

LiveServerThread requires staticfiles

Reported by: joel@… Owned by: nobody
Component: Testing framework Version: 1.4-alpha-1
Severity: Normal Keywords:
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

I've found a bug in LiveServerThread (added as part of #2879). To reproduce:

  • Have a Django app with staticfiles disabled, and no STATIC_URL setting
  • Write a test case that uses LiveServerTestCase, such as the following:
    class SomeTestCase(django.test.LiveServerTestCase):
        def test(self):
            pass
    
  • Run the test

Instead of passing, the test fails during the SetUpClass stage. The error given is as follows:

ImproperlyConfigured: You're using the staticfiles app without having set the required STATIC_URL setting.

Attachments (0)

Change History (1)

comment:1 Changed 2 years ago by ramiro

  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset
  • Resolution set to invalid
  • Status changed from new to closed

But, the dependency of LiveServerTestCase on the staticfiles contrib app is documented: https://docs.djangoproject.com/en/dev/topics/testing/#live-test-server The first Note box reads:

Note

LiveServerTestCase makes use of the staticfiles contrib app so you'll need to have your project configured accordingly (in particular by setting STATIC_URL).

Last edited 2 years ago by ramiro (previous) (diff)

Add Comment

Modify Ticket

Change Properties
<Author field>
Action
as closed
as The resolution will be set. Next status will be 'closed'
The resolution will be deleted. Next status will be 'new'
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.