Re: [Django] #2879: Add live test server support to test framework

2011-12-28 Thread Django
#2879: Add live test server support to test framework
-+-
 Reporter:  Mikeal Rogers|Owner:  devin
   |   Status:  closed
 Type:  New feature  |  Version:
Component:  Testing framework|   Resolution:  fixed
 Severity:  Normal   | Triage Stage:  Ready for
 Keywords:   |  checkin
Has patch:  1|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+-
Changes (by jian@…):

 * cc: jian@… (added)


-- 
Ticket URL: 
Django 
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.



Re: [Django] #2879: Add live test server support to test framework

2011-12-22 Thread Django
#2879: Add live test server support to test framework
-+-
 Reporter:  Mikeal Rogers|Owner:  devin
   |   Status:  closed
 Type:  New feature  |  Version:
Component:  Testing framework|   Resolution:  fixed
 Severity:  Normal   | Triage Stage:  Ready for
 Keywords:   |  checkin
Has patch:  1|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+-

Comment (by julien):

 My sincere apologies to Florian Apolloner and Jonas Obrist, who I've
 failed to mention in the commit message and who also provided excellent
 feedback!

-- 
Ticket URL: 
Django 
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.



Re: [Django] #2879: Add live test server support to test framework

2011-12-22 Thread Django
#2879: Add live test server support to test framework
-+-
 Reporter:  Mikeal Rogers|Owner:  devin
   |   Status:  closed
 Type:  New feature  |  Version:
Component:  Testing framework|   Resolution:  fixed
 Severity:  Normal   | Triage Stage:  Ready for
 Keywords:   |  checkin
Has patch:  1|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+-
Changes (by julien):

 * status:  new => closed
 * resolution:   => fixed


Comment:

 In [17241]:
 {{{
 #!CommitTicketReference repository="" revision="17241"
 Fixed #2879 -- Added support for the integration with Selenium and other
 in-browser testing frameworks. Also added the first Selenium tests for
 `contrib.admin`. Many thanks to everyone for their contributions and
 feedback: Mikeal Rogers, Dirk Datzert, mir, Simon G., Almad, Russell
 Keith-Magee, Denis Golomazov, devin, robertrv, andrewbadr, Idan Gazit,
 voidspace, Tom Christie, hjwp2, Adam Nelson, Jannis Leidel, Anssi
 Kääriäinen, Preston Holmes, Bruno Renié and Jacob Kaplan-Moss.
 }}}

-- 
Ticket URL: 
Django 
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.



Re: [Django] #2879: Add live test server support to test framework

2011-12-21 Thread Django
#2879: Add live test server support to test framework
-+-
 Reporter:  Mikeal Rogers|Owner:  devin
   |   Status:  new
 Type:  New feature  |  Version:
Component:  Testing framework|   Resolution:
 Severity:  Normal   | Triage Stage:  Ready for
 Keywords:   |  checkin
Has patch:  1|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+-
Changes (by jezdez):

 * stage:  Accepted => Ready for checkin


-- 
Ticket URL: 
Django 
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.



Re: [Django] #2879: Add live test server support to test framework

2011-12-19 Thread Django
#2879: Add live test server support to test framework
-+-
 Reporter:  Mikeal Rogers|Owner:  devin
   |   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:  0
  Needs tests:  0|UI/UX:  0
Easy pickings:  0|
-+-

Comment (by akaariai):

 Still a couple of minor things.

 If I am not mistaken this part of admin_login will not work in i18n
 setting: It is not "Log in" in Finnish :)
 {{{
 self.selenium.find_element_by_xpath('//input[@value="Log in"]').click()
 }}}
 The same language-dependency is also visible in the admin_inlines tests.
 These can probably be fixed later on.

 A small nitpick: some method docstrings are written as:
 {{{
 """Comment begins here
 ...
 """
 }}}
 whereas I believe the recommended style is:
 {{{
 """
 Comment begins on separate line...
 """
 }}}

 Last nitpick is the handling of exceptions in `LiveServerThread`.run().
 You fixed the exception from missing STATIC_URL, but I think it would be
 good to have
 {{{
 except Exception, e:
 self.e = e
 self.is_ready.set()
 raise
 }}}
 in the end of the run method, below the except `WSGIServerException`. It
 is unlikely the general "except Exception:" is ever hit, but if it is for
 some reason (out of memory or something...) this will prevent lockup.

 As said, just minor nitpicks. I haven't fully tested the latest patch, but
 I think it is possible to commit this as is, and then fix the issues once
 this is committed.

-- 
Ticket URL: 
Django 
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.



Re: [Django] #2879: Add live test server support to test framework

2011-12-19 Thread Django
#2879: Add live test server support to test framework
-+-
 Reporter:  Mikeal Rogers|Owner:  devin
   |   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:  0
  Needs tests:  0|UI/UX:  0
Easy pickings:  0|
-+-
Changes (by julien):

 * needs_better_patch:  1 => 0


Comment:

 The latest (and hopefully last) patch doesn't use settings anymore.
 Instead it uses a single environment variable holding the default address
 'localhost:8081'. To override that default address, one can pass the
 `--liveserver` option to the '`manage.py test`' command.

 By the way, I've figured out why a missing STATIC_URL used to cause the
 test to freeze. It was because the generated exception didn't bubble up to
 the main thread, which in turn could not release the live server's socket.
 It is still worth leaving the safety shutdown mechanism for the case where
 the user has an infinite loop in their views though. This is now all fixed
 and tested in the new patch.

-- 
Ticket URL: 
Django 
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.



Re: [Django] #2879: Add live test server support to test framework

2011-12-17 Thread Django
#2879: Add live test server support to test framework
-+-
 Reporter:  Mikeal Rogers|Owner:  devin
   |   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):

 The live-server still requires STATIC_URL, it just doesn't get stuck if it
 is missing. So, it is fixed only in that sense.

 It would be nice if the stacktraces for missing 500.html would not get
 printed. But it isn't that important...

-- 
Ticket URL: 
Django 
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.



Re: [Django] #2879: Add live test server support to test framework

2011-12-17 Thread Django
#2879: Add live test server support to test framework
-+-
 Reporter:  Mikeal Rogers|Owner:  devin
   |   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):

 akaariai: Your suggestion for preventing dead locks when shutting down the
 live server makes sense. I've made the change in the latest patch,
 although I've borrowed some code from Python 2.7 to do the implementation
 (see the `_ImprovedEvent` class). I also agree about documenting the use
 of setUpClass/tearDownClass and including that change in the latest patch.

 However, I'm not sure how your suggestion addresses the `STATIC_URL`
 issue. Could you elaborate on that? I haven't had the time to investigate
 it fully myself yet. It seems at the very least there should be some
 documentation about it.

 From what I recall in the early days that I worked on this patch, I now
 remember having hit some issues if the tested site didn't include a
 favicon.ico, 404.html or 500.html files. Either the code should handle
 those cases or that should be documented.

-- 
Ticket URL: 
Django 
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.



Re: [Django] #2879: Add live test server support to test framework

2011-12-17 Thread Django
#2879: Add live test server support to test framework
-+-
 Reporter:  Mikeal Rogers|Owner:  devin
   |   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):

 Ok, I did some investigation, and now STATIC_URL and quitting the tests
 when the server hits forever-loop should work.

 Attached is an incremental patch for the .10. patch. The stuff in my patch
 isn't polished at all, but it should show the problematic places, and at
 least some way to fix them.

 One thing about documentation: I wonder if it is a good advice to do
 selenium setup / quit in tearDown and setUp. This makes each test_method
 take about 7 seconds on my system (for each test method, start and stop
 Firefox).  Would it be better to advice the use of tearDownClass and
 setUpClass? This way Firefox is started only once per test class. On the
 other hand, this has a bit bigger chance of hitting cross-test
 dependencies. Maybe at least mention in the documentation that this is
 also possible? From my point of view, this documentation polishing can be
 done after initial commit.

-- 
Ticket URL: 
Django 
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.



Re: [Django] #2879: Add live test server support to test framework

2011-12-16 Thread Django
#2879: Add live test server support to test framework
-+-
 Reporter:  Mikeal Rogers|Owner:  devin
   |   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: 
Django 
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.



Re: [Django] #2879: Add live test server support to test framework

2011-12-16 Thread Django
#2879: Add live test server support to test framework
-+-
 Reporter:  Mikeal Rogers|Owner:  devin
   |   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()
 >   
 >   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):
 >   
 >   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: 
Django 
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.



Re: [Django] #2879: Add live test server support to test framework

2011-12-16 Thread Django
#2879: Add live test server support to test framework
-+-
 Reporter:  Mikeal Rogers|Owner:  devin
   |   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):

 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.

 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()
   File "/home/akaj/Django/django_test/django/test/testcases.py", line 861,
 in run
 handler = StaticFilesHandler(MediaFilesHandler(WSGIHandler()))
   File
 "/home/akaj/Django/django_test/django/contrib/staticfiles/handlers.py",
 line 21, in __init__
 self.base_url = urlparse(self.get_base_url())
   File
 "/home/akaj/Django/django_test/django/contrib/staticfiles/handlers.py",
 line 28, in get_base_url
 utils.check_settings()
   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.

 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):
   File "/usr/lib/python2.6/wsgiref/handlers.py", line 93, in run
 self.result = application(self.environ, self.start_response)
   File
 "/home/akaj/Django/django_test/django/contrib/staticfiles/handlers.py",
 line 67, in __call__
 return self.application(environ, start_response)
   File
 "/home/akaj/Django/django_test/django/contrib/staticfiles/handlers.py",
 line 68, in __call__
 return super(StaticFilesHandler, self).__call__(environ,
 start_response)
   File "/home/akaj/Django/django_test/django/core/handlers/wsgi.py", line
 242, in __call__
 response = self.get_response(request)
   File
 "/home/akaj/Django/django_test/django/contrib/staticfiles/handlers.py",
 line 63, in get_response
 return super(StaticFilesHandler, self).get_response(request)
   File "/home/akaj/Django/django_test/django/core/handlers/base.py", line
 153, in get_response
 response = self.handle_uncaught_exception(request, resolver,
 sys.exc_info())
   File "/home/akaj/Django/django_test/django/core/handlers/base.py", line
 228, in handle_uncaught_exception
 return callback(request, **param_dict)
   File "/home/akaj/Django/django_test/django/utils/decorators.py", line
 91, in _wrapped_view
 response = view_func(request, *args, **kwargs)
   File "/home/akaj/Django/django_test/django/views/defaults.py", line 32,
 in server_error
 t = loader.get_template(template_name) # You need to create a 500.html
 template.
   File "/home/akaj/Django/django_test/django/template/loader.py", line
 145, in get_template
 template, origin = find_template(template_name)
   File "/home/akaj/Django/django_test/django/template/loader.py", line
 138, in find_template
 raise TemplateDoesNotExist(name)
 TemplateDoesNotExist: 500.html
 Traceback (most recent call last):
   File "/usr/lib/python2.6/wsgiref/handlers.py", line 93, in run
 self.result = application(self.environ, self.start_response)
   File
 "/home/akaj/Django/django_test/django/contrib/staticfiles/handlers.py",
 line 67, in __call__
 return self.application(environ, start_response)
   File
 "/home/akaj/Django/django_test/django/contrib/staticfiles/handlers.py",
 line 68, in __call__
 return super(StaticFilesHandler, self).__call__(environ,
 start_response)
   File "/home/akaj/Django/django_test/django/core/handlers/wsgi.py", line
 242, in __call__
 response = self.get_response(request)
   File
 "/home/akaj/Django/django_test/django/con

Re: [Django] #2879: Add live test server support to test framework

2011-12-16 Thread Django
#2879: Add live test server support to test framework
-+-
 Reporter:  Mikeal Rogers|Owner:  devin
   |   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):

 What I am trying to say is that a) the comment refers to connection's
 cursor sharing (when in my opinion it should say something about shared
 transactions) and b) the test methods must be written as:
 {{{
 def test_something():
 do_setup()
 commit # MUST commit if you are altering the database in some way
# and wish it to be visible to the live-server. If no changes,
# commit is of course optional.
 selenium.do_request() # the test-server can now run in its own
 transaction,
   # which can see things done in do_setup()
 inspect_results()
 }}}

 My main point is that if you do per-test-method setup which write to the
 DB, you must commit those changes before doing the request to the test-
 server. Otherwise, the setup will not be visible to the test-server when
 it handles the request.

 Of course, if you are doing more than one request to the db in single
 test, and doing more setup between the request, you must commit the
 changes between each request. So before each request, commit changes (if
 anything to commit).

 I do not see transaction commits forced in code, or mentioned in the
 documentation. I think this should at least be mentioned in the
 documentation. When writing this, I am beginning to think that the correct
 solution is to enforce all open transactions are non-dirty before request
 are made. But enforcing that seems problematic...

-- 
Ticket URL: 
Django 
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.



Re: [Django] #2879: Add live test server support to test framework

2011-12-16 Thread Django
#2879: Add live test server support to test framework
-+-
 Reporter:  Mikeal Rogers|Owner:  devin
   |   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|
-+-
Changes (by julien):

 * stage:  Ready for checkin => Accepted


Comment:

 ptone: thanks for your docs feedback!

 akaariai: Are you suggesting that only the comment be changed and/or that
 `LiverServerTestCase` should inherit from `TestCase` instead of
 `TransactionTestCase`?

 Also, it's been suggested on IRC that to avoid adding 2 new settings the
 live server's host and port could be passed as options to the `manage.py
 test` command. That sounds like a good idea, but at this stage I'm
 wondering how this could work if one is using a different test runner than
 Django's.

-- 
Ticket URL: 
Django 
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.



Re: [Django] #2879: Add live test server support to test framework

2011-12-16 Thread Django
#2879: Add live test server support to test framework
-+-
 Reporter:  Mikeal Rogers|Owner:  devin
   |   Status:  new
 Type:  New feature  |  Version:
Component:  Testing framework|   Resolution:
 Severity:  Normal   | Triage Stage:  Ready for
 Keywords:   |  checkin
Has patch:  1|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  1
Easy pickings:  0|UI/UX:  0
-+-

Comment (by ptone):

 Some very minor docs feedback:

 1844:

 :class:`~django.test.TransactionTestCase` with one extra thing: it
 launches a

 :class:`~django.test.TransactionTestCase` with one extra feature: it
 launches a

 1846:

 This allows to use other automated test clients than the

 This allows the use of automated test clients other than the

 Looks like a great patch!

-- 
Ticket URL: 
Django 
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.



Re: [Django] #2879: Add live test server support to test framework

2011-12-16 Thread Django
#2879: Add live test server support to test framework
-+-
 Reporter:  Mikeal Rogers|Owner:  devin
   |   Status:  new
 Type:  New feature  |  Version:
Component:  Testing framework|   Resolution:
 Severity:  Normal   | Triage Stage:  Ready for
 Keywords:   |  checkin
Has patch:  1|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  1
Easy pickings:  0|UI/UX:  0
-+-
Changes (by unbracketed):

 * cc: unbracketed (added)


-- 
Ticket URL: 
Django 
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.



Re: [Django] #2879: Add live test server support to test framework

2011-12-16 Thread Django
#2879: Add live test server support to test framework
-+-
 Reporter:  Mikeal Rogers|Owner:  devin
   |   Status:  new
 Type:  New feature  |  Version:
Component:  Testing framework|   Resolution:
 Severity:  Normal   | Triage Stage:  Ready for
 Keywords:   |  checkin
Has patch:  1|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  1
Easy pickings:  0|UI/UX:  0
-+-
Changes (by akaariai):

 * cc: anssi.kaariainen@… (added)


Comment:

 Spotted one comment which is a bit misleading.

 The comment containing the snippet "the threads do not share the same
 connection's cursor (unless if using in-memory sqlite)." isn't exactly
 correct:  This is not about sharing cursors, but that in general the setup
 must be:
  - `TestCase`: sets up database state, commits. Makes request (by selenium
 or whatever have you).
  - `TestServer`: serves the request normally, this means usually a
 transaction is made and committed.
  - `TestCase`: checks database state (yet another transaction).

 So, that comment might need updating. Also, it would be good to document
 the above. Maybe all that is needed is: "remember to commit changes to db-
 state before making requests". If there is no commit, the test-server
 thread's connection will not see those changes, unless using inmemory-
 sqlite.

-- 
Ticket URL: 
Django 
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.



Re: [Django] #2879: Add live test server support to test framework

2011-12-16 Thread Django
#2879: Add live test server support to test framework
-+-
 Reporter:  Mikeal Rogers|Owner:  devin
   |   Status:  new
 Type:  New feature  |  Version:
Component:  Testing framework|   Resolution:
 Severity:  Normal   | Triage Stage:  Ready for
 Keywords:   |  checkin
Has patch:  1|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  1
Easy pickings:  0|UI/UX:  0
-+-

Comment (by julien):

 In [17205]:
 {{{
 #!CommitTicketReference repository="" revision="17205"
 Fixed #17258 -- Moved `threading.local` from `DatabaseWrapper` to the
 `django.db.connections` dictionary. This allows connections to be
 explicitly shared between multiple threads and is particularly useful for
 enabling the sharing of in-memory SQLite connections. Many thanks to Anssi
 Kääriäinen for the excellent suggestions and feedback, and to Alex
 Gaynor for the reviews. Refs #2879.
 }}}

-- 
Ticket URL: 
Django 
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.



Re: [Django] #2879: Add live test server support to test framework

2011-12-09 Thread Django
#2879: Add live test server support to test framework
-+-
 Reporter:  Mikeal Rogers|Owner:  devin
   |   Status:  new
 Type:  New feature  |  Version:
Component:  Testing framework|   Resolution:
 Severity:  Normal   | Triage Stage:  Ready for
 Keywords:   |  checkin
Has patch:  1|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  1
Easy pickings:  0|UI/UX:  0
-+-
Changes (by jezdez):

 * stage:  Accepted => Ready for checkin


Comment:

 Replying to [comment:83 julien]:
 > Replying to [comment:76 jezdez]:
 > > - The new `LIVE_TEST_SERVER_HOST` and `LIVE_TEST_SERVER_PORT` settings
 are much too specific for Selenium (including the fact that "http" is
 hardcoded in `LiveServerTestCase`). I suggest introducing justa
 `LIVE_TEST_SERVER` setting instead and ask the users to give it a full
 URL, e.g. 'http://localhost/8081/'). Even though we have separate settings
 for email servers (`EMAIL_HOST` and `EMAIL_PORT`) the live test server has
 a lax API and shouldn't be hardwired to require protocol, host and port.
 >
 > Internally the `WSGIServer` opens a socket and binds it to a server
 address that has to be a pair (host, port), so we might have to keep that
 API too. What do you think?

 Ah, yeah, I misinterpreted the use. Looks good to me now.

 > > - The docs don't mention how to run the Selenium based tests except
 installing the selenium Python library. I suggest to add a small section
 about how to get Selenium to run in the first place (basically only where
 to download and how to run, like mentioned on
 http://pypi.python.org/pypi/selenium).
 >
 > As discussed on IRC, it is really as simple as installing the selenium
 package. The documentation could perhaps be improved, but it already
 contains all you need to get started.

 Yeah, I think this is fine for committing.

 > Finally, in the latest patch I've moved the live server tests to the
 already existing 'servers' app, and made a few small tweaks to the admin
 selenium tests.

 Woo!

-- 
Ticket URL: 
Django 
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.



Re: [Django] #2879: Add live test server support to test framework

2011-12-08 Thread Django
#2879: Add live test server support to test framework
-+-
 Reporter:  Mikeal Rogers|Owner:  devin
   |   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:76 jezdez]:
 > - In `AdminSeleniumWebDriverTestCase` (shorter name?) the `setUp` method
 re-imports and instantiates the webdriver for every test method. Using the
 setUpClass class method would be preferred (unless I'm missing some need
 for resetting it all the time).

 Agreed. I've made that change in the latest patch.

 > - The new `LIVE_TEST_SERVER_HOST` and `LIVE_TEST_SERVER_PORT` settings
 are much too specific for Selenium (including the fact that "http" is
 hardcoded in `LiveServerTestCase`). I suggest introducing justa
 `LIVE_TEST_SERVER` setting instead and ask the users to give it a full
 URL, e.g. 'http://localhost/8081/'). Even though we have separate settings
 for email servers (`EMAIL_HOST` and `EMAIL_PORT`) the live test server has
 a lax API and shouldn't be hardwired to require protocol, host and port.

 Internally the `WSGIServer` opens a socket and binds it to a server
 address that has to be a pair (host, port), so we might have to keep that
 API too. What do you think?

 > - The docs don't mention how to run the Selenium based tests except
 installing the selenium Python library. I suggest to add a small section
 about how to get Selenium to run in the first place (basically only where
 to download and how to run, like mentioned on
 http://pypi.python.org/pypi/selenium).

 As discussed on IRC, it is really as simple as installing the selenium
 package. The documentation could perhaps be improved, but it already
 contains all you need to get started.

 Finally, in the latest patch I've moved the live server tests to the
 already existing 'servers' app, and made a few small tweaks to the admin
 selenium tests.

-- 
Ticket URL: 
Django 
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.



Re: [Django] #2879: Add live test server support to test framework

2011-12-01 Thread Django
#2879: Add live test server support to test framework
-+-
 Reporter:  Mikeal Rogers|Owner:  devin
   |   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):

 I've spent some time trying to make it work for in-memory sqlite databases
 but unfortunately it looks like this may not be achievable. So, as
 suggested by Almad, I've made it to skip the tests in that case.

 Also, you'll note that `LiveServerTestCase` now inherits from
 `TransactionTestCase` instead of `TestCase`. The problem with `TestCase`
 is that changes are not committed and therefore the live server's database
 connection can't have access to them since it uses a different cursor.

 Finally, I've made the live server serve media files by introducing a new
 `MediaFilesHandler` class based on `StaticFilesHandler`. Maybe there's a
 better approach so, as always, any feedback is welcome! :)

 PS: Tom, I've had some issues applying your previous patch. In particular
 some new files seemed to be missing. Are you creating the diff from the
 working directory? If so, I usually achieve this by staging all the files
 I want to diff and then by running: `git diff --staged > mypatch.diff`.
 Although it feels there has to be a better way!

-- 
Ticket URL: 
Django 
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.



Re: [Django] #2879: Add live test server support to test framework

2011-11-21 Thread Django
#2879: Add live test server support to test framework
-+-
 Reporter:  Mikeal Rogers|Owner:  devin
   |   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 tomchristie):

 Not sure, but you might need to add the new directories prior to applying
 the patch:

 {{{
 mkdir -p tests/regressiontests/live_server_tests/{media,static}
 }}}

 I'd missed out the example media and static file before - should be more
 clear now.
 So there's a test file in each of the `static` and `media` directories,
 and we'd expect them to serve from `/static/` and `/media/`.

 We're already making the implicit assumption that we want to serve static
 files, with the equivalent of:
 {{{
 urlpatterns += staticfiles_urlpatterns()
 }}}

 If `MEDIA_ROOT` is set, and `MEDIA_URL` is set to a relative URL, then we
 ought to also do the equivalent of:
 {{{
 urlpatterns += static(settings.MEDIA_URL,
 document_root=settings.MEDIA_ROOT)
 }}}

 (As it happens, I actually think Django's "use `settings.DEBUG` to
 determine if we should serve static/media files" is a slightly flawed in
 the first place, seeing as it's forced to `False` in testing.)

 I might take a look at seeing if I can adapt the implementation to be
 multi-process rather than multi-thread, and support on-disk sqlite
 databases.

-- 
Ticket URL: 
Django 
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.



Re: [Django] #2879: Add live test server support to test framework

2011-11-21 Thread Django
#2879: Add live test server support to test framework
-+-
 Reporter:  Mikeal Rogers|Owner:  devin
   |   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 Almad):

 Replying to [comment:79 julien]:
 > So, instead of recreating a new database in the separate thread, we
 should make sqlite share the same in-memory database by setting
 `DATABASES['default']['OPTIONS']['check_same_thread']` to False in
 `LiveServerTestCase.setUp()`. I haven't tested that yet. You can google
 'check_same_thread' for more info — some people claim that it works and
 others that it doesn't. If no solution can be found then it looks like in-
 memory sqlite databases might not be supported by this approach.

 This totally depends on whether test wants to share data / how
 transactions should behave. In django-sane-testing, we opted to skip the
 live server tests when using in-memory SQLite database, because one cannot
 correctly predict the test intentions.

-- 
Ticket URL: 
Django 
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.



Re: [Django] #2879: Add live test server support to test framework

2011-11-20 Thread Django
#2879: Add live test server support to test framework
-+-
 Reporter:  Mikeal Rogers|Owner:  devin
   |   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):

 Thanks, Tom, those tests are very useful!

 (By the way, there seems to be a problem with your latest patch as it
 didn't apply cleanly with 'git apply'. I had to use the 'patch -p1'
 command and then manually create the `live_server_tests/__init__.py` file)

 The process termination issue is a weird one. It seems to only occur with
 Python 2.7, as it works fine with Python 2.5&6. Also, adding
 `sleep(0.001)` at the end of `LiveServerTestCase.tearDown()` seems to fix
 it — although that wouldn't be acceptable as a solution :)

 Threads cannot easily share memory in Python. Pysqlite addresses that
 problem by setting the `check_same_thread` parameter to `False`:
 `sqlite.connect(":memory:", check_same_thread = False)`

 So, instead of recreating a new database in the separate thread, we should
 make sqlite share the same in-memory database by setting
 `DATABASES['default']['OPTIONS']['check_same_thread']` to False in
 `LiveServerTestCase.setUp()`. I haven't tested that yet. You can google
 'check_same_thread' for more info — some people claim that it works and
 others that it doesn't. If no solution can be found then it looks like in-
 memory sqlite databases might not be supported by this approach.

 As for the media, it's unclear to me from looking at your patch what
 you're actually testing. Where are the "example_media_file.txt" and
 "example_file.txt" files supposed to be physically located and served
 from?

-- 
Ticket URL: 
Django 
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.



Re: [Django] #2879: Add live test server support to test framework

2011-11-20 Thread Django
#2879: Add live test server support to test framework
-+-
 Reporter:  Mikeal Rogers|Owner:  devin
   |   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 tomchristie):

 Made a start on some extra tests...

 {{{
 ./runtests.py --settings=test_sqlite live_server_tests
 }}}

 1. As mentioned media files not served when `MEDIA_URL` and `MEDIA_ROOT`
 set. (`test_media_files` fails).  Not 100% sure what the behavior ought to
 be here.
 2. When running with in-memory database, database changes made in live
 server thread are not visible in test thread. (`test_database_writes`
 fails)... ...I'd assume(?) that'd pass on a proper database (not had time
 to test.)
 3. When running with sqlite database using TEST_NAME in database settings,
 everything always hangs after "would you like to try deleting the test
 database" prompt.
 4. Multiple databases not yet supported? (not written a test for this
 yet.)  Looks easy to fix.
 5. Process termination problem mentioned before can occur (Eg run
 `./runtests.py --settings=test_sqlite
 live_server_tests.TestViews.test_view`)

-- 
Ticket URL: 
Django 
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.



Re: [Django] #2879: Add live test server support to test framework

2011-11-19 Thread Django
#2879: Add live test server support to test framework
-+-
 Reporter:  Mikeal Rogers|Owner:  devin
   |   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 tomchristie):

 It looks like there's a race condition involved in reloading the database
 inside the `LiveServerThread`.

 It's sporadic, but if you run an empty `LiveServerTestCase` test a few
 times you should see it manifest.
 The process will fail to shutdown after the test completes.

 {{{
 class LiveServerTest(LiveServerTestCase):
 def test_live_server(self):
 pass
 }}}


 It looks like this was previously being masked because the Selenium tests
 were preventing the race from occuring.

 I've narrowed things down to the Database creation in
 `LiveServerThread.run`.
 If that's commented out, or if it's moved into the `__init__` (ie out of
 the new thread), the process shuts down fine.

 I was thinking that it looked like the connection just needed to be
 explicitly closed and/or rolled back at the end of `run()`,
 but that didn't solve things - just made the race much less likely to
 occur, but still present occasionally.

 I'm not exactly sure what's needed to fix it, so would appreciate some
 other eyes. :)

 I'll try to find the time in the next couple of days to write up a few
 tests for !LiveServerTestCase, that
 use urllib2 or httplib to check the basics:

 * Serving views.
 * Serving 404s.
 * Serving static media.
 * Serving uploaded media, if MEDIA_URL is set.  (I'm not sure this is done
 right now? It should be, right?)
 * Ensure that fixtures are properly loaded in the live server thread.
 * Ensure that model instances are properly created in the live server
 thread.
 * Ensure that there's proper database seperation between test cases.

-- 
Ticket URL: 
Django 
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.



Re: [Django] #2879: Add live test server support to test framework

2011-11-19 Thread Django
#2879: Add live test server support to test framework
-+-
 Reporter:  Mikeal Rogers|Owner:  devin
   |   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 jezdez):

 Interesting patch indeed, I have a few issue I'd like to see fixed first
 though:

 - In `AdminSeleniumWebDriverTestCase` (shorter name?) the `setUp` method
 re-imports and instantiates the webdriver for every test method. Using the
 setUpClass class method would be preferred (unless I'm missing some need
 for resetting it all the time).

 - The new `LIVE_TEST_SERVER_HOST` and `LIVE_TEST_SERVER_PORT` settings are
 much too specific for Selenium (including the fact that "http" is
 hardcoded in `LiveServerTestCase`). I suggest introducing justa
 `LIVE_TEST_SERVER` setting instead and ask the users to give it a full
 URL, e.g. 'http://localhost/8081/'). Even though we have separate settings
 for email servers (`EMAIL_HOST` and `EMAIL_PORT`) the live test server has
 a lax API and shouldn't be hardwired to require protocol, host and port.

 - The docs don't mention how to run the Selenium based tests except
 installing the selenium Python library. I suggest to add a small section
 about how to get Selenium to run in the first place (basically only where
 to download and how to run, like mentioned on
 http://pypi.python.org/pypi/selenium).

 Other than that this looks good to me.

-- 
Ticket URL: 
Django 
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.



Re: [Django] #2879: Add live test server support to test framework

2011-11-19 Thread Django
#2879: Add live test server support to test framework
-+-
 Reporter:  Mikeal Rogers|Owner:  devin
   |   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 adamnelson):

 I don't know how big of a shift it would be but I've used
 [http://splinter.cobrateam.info/ Splinter] for testing in order to get
 around Selenium deficiencies and it works on Python 2.5.

-- 
Ticket URL: 
Django 
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.



Re: [Django] #2879: Add live test server support to test framework

2011-11-19 Thread Django
#2879: Add live test server support to test framework
-+-
 Reporter:  Mikeal Rogers|Owner:  devin
   |   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):

 I've converted the tests to using WebDriver in Firefox (tested) and IE
 (untested). Would anyone with a Windows environment be keen to try it out?
 :)

 WebDriver indeed has a number of advantages. It's faster to run, requires
 less boilerplate code, has a nicer Python API, and doesn't require to run
 the Java RC server in parallel.

 But it does also have a number of downsides. In particular it only
 supports Python 2.6 & 2.7, and some drivers (e.g. Chrome:
 http://code.google.com/p/selenium/wiki/ChromeDriver) are still lacking in
 functionality.

 I think that's ok, though. The lacking drivers will catch up and Django is
 likely going to drop Python 2.5 support in the near future.

 I've moved the base class (`AdminSeleniumWebDriverTestCase`) for the admin
 tests to `contrib/admin/tests.py`. You will also notice that the core of
 Django now doesn't contain any trace of Selenium and that the code for the
 RC flavour of Selenium present in previous patches has been removed. The
 approach here is similar with that of the one used for jQuery. Selenium
 and jQuery are both used by the admin, which in itself does represent a
 sort of "blessing", but this doesn't promote either of them as the one
 true way of handling respectively functional tests and dynamic interfaces
 in Django. This is partially to remain agnostic in regards to other
 frameworks and libraries, partially to avoid increasing the maintenance
 burden in Django core, and partially to make room for third party apps to
 develop more features around Selenium support. Again, 90% of the work is
 done by the built-in, generic, `LiveServerTestCase`. Enabling Selenium in
 your test suite then becomes as simple as:

 {{{#!python
 from django.test import LiveServerTestCase
 from selenium.webdriver.firefox.webdriver import WebDriver

 class MySeleniumTests(LiveServerTestCase):

 def setUp(self):
 self.selenium = WebDriver()
 super(MySeleniumTests, self).setUp()

 def tearDown(self):
 super(MySeleniumTests, self).tearDown()
 self.selenium.quit()

 def test_blah(self):
 ...
 }}}

 Any further feedback would be welcome. Thanks!

-- 
Ticket URL: 
Django 
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.



Re: [Django] #2879: Add live test server support to test framework

2011-11-18 Thread Django
#2879: Add live test server support to test framework
-+-
 Reporter:  Mikeal Rogers|Owner:  devin
   |   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 voidspace):

 !WebDriver is much nicer to use than the remote driver. Partly because of
 the improved api and partly because of the removal of the need to run the
 selenium jar.

 Selenium is substantially the most popular browser-driving test tool, so I
 don't see a problem in "blessing it" by providing built-in support.

-- 
Ticket URL: 
Django 
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.



Re: [Django] #2879: Add live test server support to test framework

2011-11-18 Thread Django
#2879: Add live test server support to test framework
-+-
 Reporter:  Mikeal Rogers|Owner:  devin
   |   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 tomchristie):

 > It just seems that you forgot to include the new files from
 contrib/selenium/, no?

 Oops.  Added now :) - And "git add -N" now learned!

-- 
Ticket URL: 
Django 
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.



Re: [Django] #2879: Add live test server support to test framework

2011-11-17 Thread Django
#2879: Add live test server support to test framework
-+-
 Reporter:  Mikeal Rogers|Owner:  devin
   |   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):

 One idea that's been brought up on IRC is to keep the minimal amount of
 code necessary to run the admin tests (i.e. `SeleniumTestCase`) in
 `contrib.admin.tests._selenium`, or something like that. The idea is to
 not create another contrib app, and to not bless Selenium as Django's
 official in-browser testing framework.

 `LiveServerTestCase` would obviously remain in core (in `django.test`) to
 allow third-party apps to provide support for Selenium, Windmill, etc.

 As far as the documentation is concerned, some notes would be needed in
 the contributing docs so that people know how to run the admin Selenium
 tests. For the general case, a tutorial on how to write
 Selenium/Windmill/etc. tests for a Django app or project could also be
 considered for inclusion.

-- 
Ticket URL: 
Django 
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.



Re: [Django] #2879: Add live test server support to test framework

2011-11-17 Thread Django
#2879: Add live test server support to test framework
-+-
 Reporter:  Mikeal Rogers|Owner:  devin
   |   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):

 Thank you Tom, all your changes make sense. It just seems that you forgot
 to include the new files from contrib/selenium/, no?

 I'm not sure we should create a new `contrib.selenium` app, though. The
 future trend is going to gradually split the existing contrib apps out of
 core, so adding a new one now is likely not going to fly. The most
 important thing is to provide a generic and stable API, which is already
 addressed by `LiveServerTestCase`. I think it's ok to provide full support
 for *one* flavour of Selenium (or another framework) in `django.test` so
 that the current contrib apps can be tested. I'll bring this particular
 question up on #django-dev to hear other core devs' point of view on this.

 Also, if we end up using solely `WebDriver`, then `SeleniumRCTestCase`
 should probably be split out to a third party app to reduce the
 maintenance responsibility on Django itself.

 In the meantime, the next step is to try to convert the existing admin
 tests to using `WebDriver`. I'll try to have a go at it in the coming
 days.

-- 
Ticket URL: 
Django 
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.



Re: [Django] #2879: Add live test server support to test framework

2011-11-17 Thread Django
#2879: Add live test server support to test framework
-+-
 Reporter:  Mikeal Rogers|Owner:  devin
   |   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 tomchristie):

 Attached patch does the following:

 1. Rename `SeleniumTestCase` to `SeleniumRCTestCase`, settings to
 `SELENIUM_RC_HOST`, `SELENIUM_RC_PORT`, `SELENIUM_RC_BROWSER`, and updates
 docs accordingly.
 2. Move `SeleniumTestCase` into `django.contrib.selenium`.
 3. Check for Selenium connection during the first test run, rather than at
 time of import.
 4. Move "Wait for the Django server to be ready" code out of
 `SeleniumTestCase`, into `LiveServerTestCase`.

 Feel free to pull out whatever you think is useful and chuck out the rest.

 I've take a look at using !WebDriver instead - it seems pretty complete to
 me, it's much nicer not having to have the Selenium Server running, and it
 looks a lot faster to setup/teardown. (A sample test doing a single URL
 load tended to complete in 2.0-2.5 seconds, compared to 5.0-6.0 seconds
 for the RC version).  The API is perhaps a little more verbose than it
 could be, but there's nothing obviously preventing the existing admin
 tests from being re-written for !WebDriver.

-- 
Ticket URL: 
Django 
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.



Re: [Django] #2879: Add live test server support to test framework

2011-11-17 Thread Django
#2879: Add live test server support to test framework
-+-
 Reporter:  Mikeal Rogers|Owner:  devin
   |   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 tomchristie):

 Some thoughts:

 1. Given that the front page of http://seleniumhq.org/ now reads "Selenium
 !WebDriver is the successor of Selenium Remote Control which has been
 officially deprecated." I think we need to either support both RC and
 !WebDriver, or only !WebDriver. I'd be fine with supporting both, as the
 pragmatic approach, but it'd certainly be worth renaming
 `SeleniumTestCase` to `SeleniumRCTestCase`.  Supporting !WebDriver could
 then be a separate ticket.
 2. I'm not sure it's okay to attempt making an HTTP connection whenever
 importing django.test.testcases.  Waiting until the first test is run
 would probably be better [https://gist.github.com/1372740].
 3. Would it be worth considering moving `SeleniumTestCase` (or
 `SeleniumRCTestCase` and `SeleniumWebDriverTestCase`) into a new package
 `django.contrib.selenium`?  (Obviously `LiveServerTest` would stay in
 `django.test`)

-- 
Ticket URL: 
Django 
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.



Re: [Django] #2879: Add live test server support to test framework

2011-11-16 Thread Django
#2879: Add live test server support to test framework
-+-
 Reporter:  Mikeal Rogers|Owner:  devin
   |   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):

 @hjwp2 The Selenium-specific code in this patch is quite minimal and
 indeed it only concerns the Remote Control (RC) flavour. Most of the
 patch's code is for `LiveServerTestCase`, which makes it easy to plug any
 other functional testing frameworks like Selenium or Windmill and unit
 testing frameworks like QUnit. Specific implementations for supporting
 those frameworks should be done outside of Django itself and in third-
 party packages. However, it's necessary for Django to ship full support
 for at least *one* of them, so that tests can be written for its own code
 (e.g. admin, auth, comments). So far I've picked Selenium RC and wrote a
 few tests for the admin as a proof of concept. It seems like WebDriver is
 currently not as fully-featured as RC but it's catching up and it's going
 to be the future of Selenium. So it would probably be wiser to pick it now
 as a longer-term solution. I'll see if the tests I wrote can easily be
 converted. If you've got some experience with WebDriver then please feel
 free to chime in.

-- 
Ticket URL: 
Django 
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.



Re: [Django] #2879: Add live test server support to test framework

2011-11-16 Thread Django
#2879: Add live test server support to test framework
-+-
 Reporter:  Mikeal Rogers|Owner:  devin
   |   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 hjwp2@…):

 +1, great feature - looked through the patch, everything makes sense.

 I would note that it's aimed at the "RC" flavour of selenium.  There's
 another flavour called "WebDriver" which is slightly less complex, and for
 example doesn't require the .jar proxy server to be running.

 It looks like it would be reasonably easy to support WebDriver in a future
 version - it would be an alternative subclass of LiveServerTestCase,
 perhaps called SeleniumWebDriverTestCase, which would suggest renaming
 SeleniumTestCase to SeleniumRCTestCase.

 But I don't think this needs to affect the release of the patch as it
 is...  If I get some time I could have a crack at writing some additions,
 but I don't want to delay this being released as it is...

-- 
Ticket URL: 
Django 
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.



Re: [Django] #2879: Add live test server support to test framework

2011-11-16 Thread Django
#2879: Add live test server support to test framework
-+-
 Reporter:  Mikeal Rogers|Owner:  devin
   |   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|
-+-
Changes (by hjwp2@…):

 * cc: hjwp2@… (added)


-- 
Ticket URL: 
Django 
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.



Re: [Django] #2879: Add live test server support to test framework

2011-11-16 Thread Django
#2879: Add live test server support to test framework
-+-
 Reporter:  Mikeal Rogers|Owner:  devin
   |   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|
-+-
Changes (by frankoid):

 * cc: frankoid (added)


-- 
Ticket URL: 
Django 
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.



Re: [Django] #2879: Add live test server support to test framework

2011-11-16 Thread Django
#2879: Add live test server support to test framework
-+-
 Reporter:  Mikeal Rogers|Owner:  devin
   |   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|
-+-
Changes (by tomchristie):

 * cc: tom@… (added)


-- 
Ticket URL: 
Django 
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.



Re: [Django] #2879: Add live test server support to test framework

2011-11-15 Thread Django
#2879: Add live test server support to test framework
-+-
 Reporter:  Mikeal Rogers|Owner:  devin
   |   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 idangazit):

 Read through the patch—it looks sensible and well documented, and includes
 a few example tests to ease authoring of frontend tests in the admin.

 I'll pull the patch tonight and play with it, but on the face of it, looks
 fantastic. Nothing missing. Will be very exciting to have this in Django.
 +1!

-- 
Ticket URL: 
Django 
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.



Re: [Django] #2879: Add live test server support to test framework

2011-11-15 Thread Django
#2879: Add live test server support to test framework
-+-
 Reporter:  Mikeal Rogers|Owner:  devin
   |   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):

 The patch now comes with full documentation and is candidate for RFC. Any
 feedback welcome. Thanks!

-- 
Ticket URL: 
Django 
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.



Re: [Django] #2879: Add live test server support to test framework

2011-11-08 Thread Django
#2879: Add live test server support to test framework
-+-
 Reporter:  Mikeal Rogers|Owner:  devin
   |   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):

 The latest patch brings two major improvements: 1) static media are now
 handled properly, allowing Selenium tests to be run from a project via
 `manage.py test` (the previous patch only allowed them to work in the
 Django test suite); and 2) I think I've solved the threading issues by
 borrowing a bit of code from `SocketServer.BaseServer` in Python 2.6.

 I'm now reasonably happy with the implementation and will move on to
 writing more documentation. At this stage I'd really appreciate getting
 some feedback from testers so we can identify and address any edge cases.
 Thank you!

-- 
Ticket URL: 
Django 
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.



Re: [Django] #2879: Add live test server support to test framework

2011-11-05 Thread Django
#2879: Add live test server support to test framework
-+-
 Reporter:  Mikeal Rogers|Owner:  devin
   |   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|
-+-
Changes (by Bradley Ayers ):

 * cc: bradley.ayers@… (added)


-- 
Ticket URL: 
Django 
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.



Re: [Django] #2879: Add live test server support to test framework

2011-11-05 Thread Django
#2879: Add live test server support to test framework
-+-
 Reporter:  Mikeal Rogers|Owner:  devin
   |   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):

 To save you some time, here's how to run the few admin tests that have
 been written so far:

 {{{
 ./runtests.py --settings=test_sqlite
 admin_widgets.AdminWidgetsSeleniumTests
 ./runtests.py --settings=test_sqlite
 admin_inlines.AdminInlinesSeleniumTests.test_add_inlines
 ./runtests.py --settings=test_sqlite
 admin_inlines.AdminInlinesSeleniumTests.test_delete_inlines
 }}}

-- 
Ticket URL: 
Django 
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.



Re: [Django] #2879: Add live test server support to test framework

2011-11-05 Thread Django
#2879: Add live test server support to test framework
-+-
 Reporter:  Mikeal Rogers|Owner:  devin
   |   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):

 Thank you all for the precious early work on this. I've used the initial
 patches here and tried to come up with a clean implementation and a simple
 API (see the attached patch). I've also written a few Selenium tests for
 the admin; many more admin tests could be written but I think for now
 that's enough to show that it works.

 Several things could probably be improved. Perhaps the Selenium and live
 servers should be launched in `setUpClass()` instead of `setUp()`. There
 also probably are some edge cases that aren't covered yet, as so far I've
 only tested with sqlite on Chrome and Firefox.

 Finally, one particular comment on threading. As currently implemented,
 the live server continuously waits for requests until the `please_stop`
 event is set. Since the socket is blocked until the next request is
 received, I've made it to send on last dummy request to finally unblock
 and close the server. Although I could live with that, it'd be nice to do
 it a bit differently. Some good clues can be found there:
 http://www.velocityreviews.com/forums/t675145-stopping-socketserver-on-
 python-2-5-a.html

 I've written some doc which should hopefully be enough to get you started.
 Any feedback would be greatly appreciated. Thanks!

-- 
Ticket URL: 
Django 
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.



Re: [Django] #2879: Add live test server support to test framework

2011-08-03 Thread Django
#2879: Add live test server support to test framework
-+-
   Reporter:  Mikeal |  Owner:  devin
  Rogers   | Status:  new
   Type:  New|  Component:  Testing framework
  feature|   Severity:  Normal
  Milestone: |   Keywords:
Version: |  Has patch:  1
 Resolution: |Needs tests:  0
   Triage Stage:  Accepted   |  Easy pickings:  0
Needs documentation:  0  |
Patch needs improvement:  1  |
  UI/UX:  0  |
-+-
Changes (by ShawnMilo):

 * cc: ShawnMilo (added)
 * ui_ux:   => 0


-- 
Ticket URL: 
Django 
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.



Re: [Django] #2879: Add live test server support to test framework

2011-04-30 Thread Django
#2879: Add live test server support to test framework
-+-
   Reporter:  Mikeal |  Owner:  devin
  Rogers   | Status:  new
   Type:  New|  Component:  Testing framework
  feature|   Severity:  Normal
  Milestone: |   Keywords:
Version: |  Has patch:  1
 Resolution: |Needs tests:  0
   Triage Stage:  Accepted   |  Easy pickings:  0
Needs documentation:  0  |
Patch needs improvement:  1  |
-+-
Changes (by kmike):

 * cc: kmike84@… (added)
 * easy:   => 0


-- 
Ticket URL: 
Django 
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.



Re: [Django] #2879: Add live test server support to test framework (was: [patch] Add live test server support to test framework)

2011-04-01 Thread Django
#2879: Add live test server support to test framework
-+-
   Reporter:  Mikeal |Owner:  devin
  Rogers   |   Status:  new
   Type:  New|Component:  Testing framework
  feature| Severity:  Normal
  Milestone: | Keywords:
Version: |Has patch:  1
 Resolution: |  Needs tests:  0
   Triage Stage:  Accepted   |
Needs documentation:  0  |
Patch needs improvement:  1  |
-+-
Changes (by lrekucki):

 * cc: lrekucki@… (added)


Comment:

 I just found the need for this feature, so adding myself to CC. I'll try
 to reimplement it using unittest2, so it can benefit from class/module
 level fixtures.

-- 
Ticket URL: 
Django 
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.