FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Unit tests
Goto page Previous  1, 2
 
Post new topic   Reply to topic    PyLucid - CMS - Forum Forum Index -> system
View previous topic :: View next topic  
Author Message
jens
Administrator


Joined: 12 Oct 2005
Posts: 972
Location: duisburg, germany

PostPosted: Mon 03 Mar, 2008 11:20    Post subject: Reply with quote

Agree. With http://trac.pylucid.net/changeset/1457 i import tests instant of set os.environ["DJANGO_SETTINGS_MODULE"] in url_patterns.py
_________________

http://www.jensdiemer.de | http://www.htfx.de | http://www.python-forum.de
Back to top
View user's profile Send private message
jens
Administrator


Joined: 12 Oct 2005
Posts: 972
Location: duisburg, germany

PostPosted: Fri 07 Mar, 2008 15:55    Post subject: Reply with quote

changed the was how test users created: http://trac.pylucid.net/changeset/1469

Add the unittest "debug_mode": http://trac.pylucid.net/changeset/1470

Starts to implement a unittest for:
plugin_manager: http://trac.pylucid.net/changeset/1474
page_admin: http://trac.pylucid.net/changeset/1473
But both not completed.
_________________

http://www.jensdiemer.de | http://www.htfx.de | http://www.python-forum.de
Back to top
View user's profile Send private message
jens
Administrator


Joined: 12 Oct 2005
Posts: 972
Location: duisburg, germany

PostPosted: Thu 20 Mar, 2008 17:44    Post subject: Reply with quote

I have created a page for "Manually performed tests":

http://pylucid.org/_goto/143/manual-tests/
_________________

http://www.jensdiemer.de | http://www.htfx.de | http://www.python-forum.de
Back to top
View user's profile Send private message
jens
Administrator


Joined: 12 Oct 2005
Posts: 972
Location: duisburg, germany

PostPosted: Tue 25 Mar, 2008 15:09    Post subject: Reply with quote

@rantaaho: I have a problem. I need a way to make some teste with not existing database tables. But the tests insert always the tables. I tried to delete the tables, but this failed:
Quote:
Error: Database :memory: couldn't be flushed. Possible reasons:
* The database isn't running or isn't configured correctly.
* At least one of the expected database tables doesn't exist.
* The SQL was invalid.
Hint: Look at the output of 'django-admin.py sqlflush'. That's the SQL this command wasn't able to run.
The full error: no such table: PyLucid_style

I can't ignore the error with try...except.

I also tried something like this:
Code:
cursor.execute(u"DROP TABLE IF EXISTS django_session;")

But this failed with the same error from above.

EDIT: It's for the new middleware: http://trac.pylucid.net/changeset/1505
see also: http://trac.pylucid.net/ticket/87#comment:3
The existing unittest is here: http://trac.pylucid.net/browser/trunk/pylucid/tests/install_section.py
_________________

http://www.jensdiemer.de | http://www.htfx.de | http://www.python-forum.de
Back to top
View user's profile Send private message
jens
Administrator


Joined: 12 Oct 2005
Posts: 972
Location: duisburg, germany

PostPosted: Fri 13 Jun, 2008 21:00    Post subject: Reply with quote

OK. I find a solution: http://trac.pylucid.net/changeset/1641
But, should we find a faster was to run the test without existing database tables?
_________________

http://www.jensdiemer.de | http://www.htfx.de | http://www.python-forum.de
Back to top
View user's profile Send private message
jens
Administrator


Joined: 12 Oct 2005
Posts: 972
Location: duisburg, germany

PostPosted: Sun 29 Jun, 2008 13:20    Post subject: Reply with quote

I implement the new preferences and i write directy unittest for this. But i think writing DocTest are better for testing a model logic.

How can we mix unitest and doctests?
_________________

http://www.jensdiemer.de | http://www.htfx.de | http://www.python-forum.de
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    PyLucid - CMS - Forum Forum Index -> system All times are GMT + 1 Hour
Goto page Previous  1, 2
Page 2 of 2

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

<< back to PyLucid CMS Homepage



Powered by phpBB © 2001, 2005 phpBB Group