Re: Speeding up test database creation

2012-11-27 Thread John Maxwell
I just tried changing 'NAME' to ':memory:' and I'm still getting the same
results.

I continued with the tutorial for a while, and it turns out that the unit
tests for the polls app don't have this problem.  So now I'm beginning to
suspect that there's a problem with Django, and the implementation
of LiveServerTestCase doesn't do the usual in-memory database magic (this
may even be by design, though I can't think of any good reasons offhand).

The Selenium-based testing is not proving as useful as the tutorial sells
it, either...  When I use the find_by_name method of the browser object,
and the relevant name isn't to be found, it seems to hang indefinitely
instead of stopping and alerting me of the problem.  So combining these two
considerations, perhaps it's best to stick to unit tests and not bother
with functional tests.

On Tue, Nov 27, 2012 at 3:39 PM, Dennis Lee Bieber <wlfr...@ix.netcom.com>wrote:

> On Tue, 27 Nov 2012 13:43:37 -0800 (PST), John Maxwell
> <notifyj...@gmail.com> declaimed the following in
> gmane.comp.python.django.user:
>
> > Hm, I tried commenting out the line
> >
> > 'NAME': '/home/john/database.sqlite',
> >
> > and it still seems to be just as slow, if not slower...
> >
> > On Monday, November 26, 2012 5:56:30 AM UTC-8, Andres Reyes Monge wrote:
> > >
> > > The tutorial uses a sqlite file database not a in memory database, try
> > > omitting the name parameter and it should speed things up
>
> I suspect the best version would be to change the NAME into the
> specific string SQLite3 uses for memory -- ":memory:" (though using ""
> supposedly does the same, and may be what the previous respondent meant)
> --
> Wulfraed Dennis Lee Bieber AF6VN
> wlfr...@ix.netcom.comHTTP://wlfraed.home.netcom.com/
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To post to this group, send email to django-users@googlegroups.com.
> To unsubscribe from this group, send email to
> django-users+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Speeding up test database creation

2012-11-27 Thread John Maxwell
Hm, I tried commenting out the line

'NAME': '/home/john/database.sqlite',

and it still seems to be just as slow, if not slower...

On Monday, November 26, 2012 5:56:30 AM UTC-8, Andres Reyes Monge wrote:
>
> The tutorial uses a sqlite file database not a in memory database, try 
> omitting the name parameter and it should speed things up

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/django-users/-/yeBx31qu6sQJ.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Speeding up test database creation

2012-11-26 Thread John Maxwell
Hi all,

I've been doing the test-driven Django tutorial at 
http://www.tdd-django-tutorial.com/

I'm partway through the tutorial, and when I run the command "python 
manage.py test fts", the message "Creating test database for alias 
'default'..." gets shown for 4-5 seconds before anything else happens.  
This seems like a pretty long wait that will add up, especially if I'm 
going to be running my tests constantly as the tutorial suggests.  I've 
searched on Google some for how to speed this up, and people say that if 
sqlite is my database backend and I'm running tests, the database will be 
stored in RAM.  This appears to be the case already--the tutorial uses 
sqlite for the database backend.

So, am I missing something here?  And if not, is there some clever 
technique I can use to speed up or bypass the test database creation?  (I 
really have no idea what it's creating, to be honest... there's nothing to 
my app yet, but it still takes 4-5 seconds to create a test database?)

Thanks in advance for any help!

John

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/django-users/-/CYU4rpccsFcJ.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.