#2879: Add live test server support to test framework -------------------------------------+------------------------------------- Reporter: Mikeal Rogers | Owner: devin <mikeal@…> | Status: new Type: New feature | Version: Component: Testing framework | Resolution: Severity: Normal | Triage Stage: Accepted Keywords: | Needs documentation: 0 Has patch: 1 | Patch needs improvement: 1 Needs tests: 0 | UI/UX: 0 Easy pickings: 0 | -------------------------------------+-------------------------------------
Comment (by julien): Replying to [comment:91 akaariai]: > Re the above transaction handling: it seems that when running the test_methods, you are not running in a managed transaction state. So, all saves will be committed immediately. Thus, the above might not be such a big problem after all. Yes, this was the motivation for inheriting from `TransactionTestCase` instead of `TestCase`. It means that the tests would be slightly slower but it makes writing tests for Selenium (and other frameworks) much more friendly. Suggestions for changing the code or docs are welcome though. > While testing this patch, I got this error: > {{{ > Exception in thread Thread-1: > Traceback (most recent call last): > File "/usr/lib/python2.6/threading.py", line 532, in __bootstrap_inner > self.run() > <SNIP> > File "/home/akaj/Django/django_test/django/contrib/staticfiles/utils.py", line 49, in check_settings > "You're using the staticfiles app " > ImproperlyConfigured: You're using the staticfiles app without having set the required STATIC_URL setting. > }}} > > The test_runner just hang. ctrl-C does nothing. So 1) it seems the `StaticFilesHandler` needs STATIC_URL. 2) If you get an error in the setup of the live-server, the thread will not go away. I took a quick glance, and can't see why it doesn't go away. And 3) the live-server thread should be daemonic to minimize the potential for process-hangs. 1) The live server makes use of `STATIC_URL` and yes it needs to be provided. 2) We definitely need to change that behaviour if it's repeatable. > I also got this printout for a simple test (one get request, test one element present). > {{{ > python manage.py test --settings=settings obj_creation_speed > Creating test database for alias 'default'... > Traceback (most recent call last): > <SNIP> > File "/home/akaj/Django/django_test/django/template/loader.py", line 138, in find_template > raise TemplateDoesNotExist(name) > TemplateDoesNotExist: 500.html > . > ---------------------------------------------------------------------- > Ran 1 test in 9.317s > > OK > Destroying test database for alias 'default'... > }}} > > So, I am getting a couple of 500.html not exists for a test which is (as far as I understand) doing just a single get. This probably is due to the fact that the browser is trying to get favicon.ico from the root of the live test server's url. Also your project doesn't define a 500.html. If you add one, do you get a more specific description of the root problem? -- Ticket URL: <https://code.djangoproject.com/ticket/2879#comment:92> 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 post to this group, send email to django-updates@googlegroups.com. To unsubscribe from this group, send email to django-updates+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-updates?hl=en.