#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 akaariai): Replying to [comment:92 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. I don't see any big problem anymore about the transaction handling. I thought the test_method SQL would run in a transaction (and it actually does), but as it is not a managed transaction, all data modifying operations will commit immediately, at least as long as you use the ORM. I don't have any suggestions for improvement. > 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. It is probably a good idea to make the live-server thread daemonic in any case. That will allow the test-runner process exit even if the live-server is left alive for some reason. It doesn't have to be error in Django, the user might have an endless loop by accident in one of his views or something like that. If I have time, I will check tomorrow if I find anything about why the live-server thread gets stuck. It should be easy to reproduce the stuck thread problem. Setup a new project, make sure you don't have `STATIC_URL` defined, run some tests using `LiveServerTestCase` and see what happens. > 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? Ah, this makes sense. Again, will check tomorrow about this, although it seems there isn't much to check about. -- Ticket URL: <https://code.djangoproject.com/ticket/2879#comment:93> 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.