← Back to team overview

caneypuggies team mailing list archive

Adding UUID & version columns, and unit testing

 

Doug,

*Add the columns*

Like we discussed Wed. evening, I tested and can confirm that the two
new columns which are found on lines 82 & 83 in main.py here: 
http://bazaar.launchpad.net/~caneypuggies/reformedchurcheslocator/trunk/annotate/head%3A/rcl/model/main.py#L82

...work well enough that you can go ahead and implement similar columns
in the other tables that need them, which I think are only Person and
CGroup.  Implementing those columns in main.py is easy--just copy them
to the other table classes.  Once you've done that, create & run a new
database migration following these instructions: 
http://caneypuggies.alwaysreformed.com/wiki/DevelopingWithMigrations

*Test*

You might try creating a new person or cgroup on the "Admin" page in the
Reformed Churches Locator application, and after saving that new record,
open it up again in the Admin page to see whether a UUID was
automatically created for it in the uuid column.  It should do so,
because the model says the uuid column's default value should be a new UUID.

*Or unit test*

If you feel up to learning something completely new (I haven't shown you
all how to do this yet), you could copy
http://bazaar.launchpad.net/~caneypuggies/reformedchurcheslocator/trunk/annotate/head%3A/rcl/tests/models/test_cong.py
and make similar files for the purpose of testing the uuid columns in
the Person & CGroup tables.  Here's why this is a good idea, and how to
run the tests that can tell you whether the new code works properly: 
http://caneypuggies.alwaysreformed.com/wiki/UnitTests

*Commit & push to Launchpad*

Then, if it looks like it's working correctly, commit the changes in
Bazaar and push them to Launchpad so we can have them too.

Tim
-- 
Tim Black
Pastor, /Caney Orthodox Presbyterian Church <http://caneyopc.org>/, 206
N. Vine St, Caney, KS 67333
Web Developer & Owner, /Always Reformed Web Development
<http://www.alwaysreformed.com>/, 801 S State St, Caney, KS 67333
o (620) 879-2359 - h/o (620) 306-4624 - c (620) 306-1507
timblack1 on most chat networks - timblack11 on Skype