Re: Why i can't get the debug informations (in case of error) when i run LiveServerTestCase tests?
I admit it is vexing that Django overrides what you have specified in the settings file in this case, but it doesn't seem to be hard to override. I simply added "settings.DEBUG = True" to the beginning of the "setUp" function for the test class and that seems to do the trick. Btw, I see tracebacks in the console when a page has errors while running tests, don't you? Maybe that's a feature of django-nose, which I am using, I don't know. On Tuesday, January 29, 2013 2:39:58 AM UTC-6, Alessandro Pelliciari wrote: > When i run my selenium tests (LiveServerTestCase type) and i have some > error in my code (not in the test, i mean in the code executed, like > the homepage view i reach with selenium) i get the 500 public template > (that usually i get when i have DEBUG = False) even if i have: > > DEBUG = True > INTERNAL_IPS = ('127.0.0.1',) > > > I'm stuck with that and i can't see why my test failed (because in the > public 500 ofc i don't show the exceptions). > -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscr...@googlegroups.com. To post to this group, send email to django-users@googlegroups.com. Visit this group at http://groups.google.com/group/django-users?hl=en. For more options, visit https://groups.google.com/groups/opt_out.
Re: Why i can't get the debug informations (in case of error) when i run LiveServerTestCase tests?
pdb works but i don't want to set pdb every time i have a problem, i want to know the exception/source first this import class BaseTestCase(LiveServerTestCase): def setUp(self): setattr(settings, 'DEBUG', True) *doesn't work for me* :( Il giorno sabato 9 febbraio 2013 20:38:58 UTC+1, Ron Elliott ha scritto: > > > > On Tuesday, January 29, 2013 2:39:58 AM UTC-6, Alessandro Pelliciari wrote: >> >> Hi, I'm writing some tests with Selenium. >> >> When i run my selenium tests (LiveServerTestCase type) and i have some >> error in my code (not in the test, i mean in the code executed, like the >> homepage view i reach with selenium) i get the 500 public template (that >> usually i get when i have DEBUG = False) even if i have: >> >> DEBUG = True >> INTERNAL_IPS = ('127.0.0.1',) >> >> I'm stuck with that and i can't see why my test failed (because in the >> public 500 ofc i don't show the exceptions). >> >> When i run the runserver it works perfectly (i get the tracebacks). >> >> I've checked the ip from request.META when i run it in a selenium test >> and it's the localhost, not other network IP. >> >> *Why does it behave like that? Where can i look to resolve?* >> > this work: > > class BaseTestCase(LiveServerTestCase): > > def setUp(self): > setattr(settings, 'DEBUG', True) > > now make all of your test cases inherit from that test case > -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscr...@googlegroups.com. To post to this group, send email to django-users@googlegroups.com. Visit this group at http://groups.google.com/group/django-users?hl=en. For more options, visit https://groups.google.com/groups/opt_out.
Re: Why i can't get the debug informations (in case of error) when i run LiveServerTestCase tests?
On Tuesday, January 29, 2013 2:39:58 AM UTC-6, Alessandro Pelliciari wrote: > > Hi, I'm writing some tests with Selenium. > > When i run my selenium tests (LiveServerTestCase type) and i have some > error in my code (not in the test, i mean in the code executed, like the > homepage view i reach with selenium) i get the 500 public template (that > usually i get when i have DEBUG = False) even if i have: > > DEBUG = True > INTERNAL_IPS = ('127.0.0.1',) > > I'm stuck with that and i can't see why my test failed (because in the > public 500 ofc i don't show the exceptions). > > When i run the runserver it works perfectly (i get the tracebacks). > > I've checked the ip from request.META when i run it in a selenium test and > it's the localhost, not other network IP. > > *Why does it behave like that? Where can i look to resolve?* > this work: class BaseTestCase(LiveServerTestCase): def setUp(self): setattr(settings, 'DEBUG', True) now make all of your test cases inherit from that test case -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscr...@googlegroups.com. To post to this group, send email to django-users@googlegroups.com. Visit this group at http://groups.google.com/group/django-users?hl=en. For more options, visit https://groups.google.com/groups/opt_out.
Re: Why i can't get the debug informations (in case of error) when i run LiveServerTestCase tests?
Have you tried adding a: import pdb; pdb.set_trace() in the view to debug that way? On Jan 30, 2013 12:31 AM, "Alessandro Pelliciari"wrote: > Thanks for the answer! > > Because i'm developing and integrating some flow (social registration etc) > through tests. > > So, instead of creating every time a new user, creating a new social > association, and then after every try delete them from the database, the > test does it from me. > > So, its like a kind of dirty TDD with functional (selenium because i have > facebook login for example) testing. > > > Anyway i think i can resolve with the 500 response logging the error to > the console, but it's my first project in Django (and python) so i can't > understand completely the way to logging at this moment. > > > Alessandro > > > Il giorno mercoledì 30 gennaio 2013 03:18:46 UTC+1, Ramiro Morales ha > scritto: >> >> Ramiro Morales >> On Jan 29, 2013 12:33 PM, "Alessandro Pelliciari" >> wrote: >> > >> > thanks for the link! >> > >> > So Isn't there a way to set DEBUG=True in tests? >> >> No. There isn't (at least with the built-in testing toolbox). >> >> Now, I'm trying to understand why do you rely in the debugging 500 >> response contents on your tests. Do you screen scrap it to extract >> information about the origin of the failure? >> > -- > You received this message because you are subscribed to the Google Groups > "Django users" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to django-users+unsubscr...@googlegroups.com. > To post to this group, send email to django-users@googlegroups.com. > Visit this group at http://groups.google.com/group/django-users?hl=en. > For more options, visit https://groups.google.com/groups/opt_out. > > > -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscr...@googlegroups.com. To post to this group, send email to django-users@googlegroups.com. Visit this group at http://groups.google.com/group/django-users?hl=en. For more options, visit https://groups.google.com/groups/opt_out.
Re: Why i can't get the debug informations (in case of error) when i run LiveServerTestCase tests?
I'm struggling with the same problem. It's pretty annoying that you can't run a LiveServerTestCase with debug=True. It makes it overly hard to do TDD at the beginning of a project, because you need to customise logging behaviour to get any kind of debugging working... hp (http://www.tdd-django-tutorial.com/) On Wednesday, January 30, 2013 8:30:33 AM UTC, Alessandro Pelliciari wrote: > > Thanks for the answer! > > Because i'm developing and integrating some flow (social registration etc) > through tests. > > So, instead of creating every time a new user, creating a new social > association, and then after every try delete them from the database, the > test does it from me. > > So, its like a kind of dirty TDD with functional (selenium because i have > facebook login for example) testing. > > > Anyway i think i can resolve with the 500 response logging the error to > the console, but it's my first project in Django (and python) so i can't > understand completely the way to logging at this moment. > > > Alessandro > > > Il giorno mercoledì 30 gennaio 2013 03:18:46 UTC+1, Ramiro Morales ha > scritto: >> >> Ramiro Morales >> On Jan 29, 2013 12:33 PM, "Alessandro Pelliciari">> wrote: >> > >> > thanks for the link! >> > >> > So Isn't there a way to set DEBUG=True in tests? >> >> No. There isn't (at least with the built-in testing toolbox). >> >> Now, I'm trying to understand why do you rely in the debugging 500 >> response contents on your tests. Do you screen scrap it to extract >> information about the origin of the failure? >> > -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscr...@googlegroups.com. To post to this group, send email to django-users@googlegroups.com. Visit this group at http://groups.google.com/group/django-users?hl=en. For more options, visit https://groups.google.com/groups/opt_out.
Re: Why i can't get the debug informations (in case of error) when i run LiveServerTestCase tests?
Thanks for the answer! Because i'm developing and integrating some flow (social registration etc) through tests. So, instead of creating every time a new user, creating a new social association, and then after every try delete them from the database, the test does it from me. So, its like a kind of dirty TDD with functional (selenium because i have facebook login for example) testing. Anyway i think i can resolve with the 500 response logging the error to the console, but it's my first project in Django (and python) so i can't understand completely the way to logging at this moment. Alessandro Il giorno mercoledì 30 gennaio 2013 03:18:46 UTC+1, Ramiro Morales ha scritto: > > Ramiro Morales > On Jan 29, 2013 12:33 PM, "Alessandro Pelliciari" >> wrote: > > > > thanks for the link! > > > > So Isn't there a way to set DEBUG=True in tests? > > No. There isn't (at least with the built-in testing toolbox). > > Now, I'm trying to understand why do you rely in the debugging 500 > response contents on your tests. Do you screen scrap it to extract > information about the origin of the failure? > -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscr...@googlegroups.com. To post to this group, send email to django-users@googlegroups.com. Visit this group at http://groups.google.com/group/django-users?hl=en. For more options, visit https://groups.google.com/groups/opt_out.
Re: Why i can't get the debug informations (in case of error) when i run LiveServerTestCase tests?
Ramiro Morales On Jan 29, 2013 12:33 PM, "Alessandro Pelliciari"wrote: > > thanks for the link! > > So Isn't there a way to set DEBUG=True in tests? No. There isn't (at least with the built-in testing toolbox). Now, I'm trying to understand why do you rely in the debugging 500 response contents on your tests. Do you screen scrap it to extract information about the origin of the failure? -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscr...@googlegroups.com. To post to this group, send email to django-users@googlegroups.com. Visit this group at http://groups.google.com/group/django-users?hl=en. For more options, visit https://groups.google.com/groups/opt_out.
Re: Why i can't get the debug informations (in case of error) when i run LiveServerTestCase tests?
thanks for the link! So Isn't there a way to set DEBUG=True in tests? I have tried with @override_settings, but it didn't worked. Il giorno martedì 29 gennaio 2013 15:12:50 UTC+1, Ramiro Morales ha scritto: > > > On Jan 29, 2013 9:57 AM, "Alessandro Pelliciari" >> wrote: > > > > Hi, I'm writing some tests with Selenium. > > > > When i run my selenium tests (LiveServerTestCase type) and i have some > error in my code (not in the test, i mean in the code executed, like the > homepage view i reach with selenium) i get the 500 public template (that > usually i get when i have DEBUG = False) even if i have: > > > > DEBUG = True > > INTERNAL_IPS = ('127.0.0.1',) > > > > I'm stuck with that and i can't see why my test failed (because in the > public 500 ofc i don't show the exceptions). > > > > When i run the runserver it works perfectly (i get the tracebacks). > > > > I've checked the ip from request.META when i run it in a selenium test > and it's the localhost, not other network IP. > > > > Why does it behave like that? Where can i look to resolve? > > See > https://docs.djangoproject.com/en/1.4/topics/testing/#other-test-conditions > -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscr...@googlegroups.com. To post to this group, send email to django-users@googlegroups.com. Visit this group at http://groups.google.com/group/django-users?hl=en. For more options, visit https://groups.google.com/groups/opt_out.
Re: Why i can't get the debug informations (in case of error) when i run LiveServerTestCase tests?
On Jan 29, 2013 9:57 AM, "Alessandro Pelliciari"wrote: > > Hi, I'm writing some tests with Selenium. > > When i run my selenium tests (LiveServerTestCase type) and i have some error in my code (not in the test, i mean in the code executed, like the homepage view i reach with selenium) i get the 500 public template (that usually i get when i have DEBUG = False) even if i have: > > DEBUG = True > INTERNAL_IPS = ('127.0.0.1',) > > I'm stuck with that and i can't see why my test failed (because in the public 500 ofc i don't show the exceptions). > > When i run the runserver it works perfectly (i get the tracebacks). > > I've checked the ip from request.META when i run it in a selenium test and it's the localhost, not other network IP. > > Why does it behave like that? Where can i look to resolve? See https://docs.djangoproject.com/en/1.4/topics/testing/#other-test-conditions -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscr...@googlegroups.com. To post to this group, send email to django-users@googlegroups.com. Visit this group at http://groups.google.com/group/django-users?hl=en. For more options, visit https://groups.google.com/groups/opt_out.
Why i can't get the debug informations (in case of error) when i run LiveServerTestCase tests?
Hi, I'm writing some tests with Selenium. When i run my selenium tests (LiveServerTestCase type) and i have some error in my code (not in the test, i mean in the code executed, like the homepage view i reach with selenium) i get the 500 public template (that usually i get when i have DEBUG = False) even if i have: DEBUG = True INTERNAL_IPS = ('127.0.0.1',) I'm stuck with that and i can't see why my test failed (because in the public 500 ofc i don't show the exceptions). When i run the runserver it works perfectly (i get the tracebacks). I've checked the ip from request.META when i run it in a selenium test and it's the localhost, not other network IP. *Why does it behave like that? Where can i look to resolve?* -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscr...@googlegroups.com. To post to this group, send email to django-users@googlegroups.com. Visit this group at http://groups.google.com/group/django-users?hl=en. For more options, visit https://groups.google.com/groups/opt_out.