Multiple Databases in 1.2 (and Spam)

1 view
Skip to first unread message

andrew cooke

unread,
Sep 18, 2010, 6:54:25 AM9/18/10
to Django: sane testing

Hi,

Could you clarify whether multiple databases are supported in 1.2?
There's a comment at http://devel.almad.net/trac/django-sane-testing/
that suggests yes, but the issue in the Trac is still open and I
couldn't see any related commits.

For example, my settings.py has DATABASES = {....} which is not
handled by the Django Selenium test runner package.

Also, I have had success beating spam on Google Groups by selecting
"Anyone can join" AND "Messages from new members are moderated" (which
appears when you select "No moderation - messages are delivered
directly"). That works differently to the way you have things, in
that people simply post a message and you (as administrator) then get
an email (on the first post) asking you to approve the message. The
disadvantage is that you get an email when spammers post, but the two
advantages are that (1) spam doesn't appear in the group and (2) users
don't have to register separately. I think you'll find that the
second point encourages more people to post (people see the
registration message and walk away, or registe but never return to ask
a question).

Anyway, thanks for the work you've put into this package,
Andrew

Almad

unread,
Sep 18, 2010, 9:30:23 AM9/18/10
to django-sa...@googlegroups.com
Hi,

On Saturday 18 of September 2010 12:54:25 andrew cooke wrote:
> Hi,
>
> Could you clarify whether multiple databases are supported in 1.2?
> There's a comment at http://devel.almad.net/trac/django-sane-testing/
> that suggests yes, but the issue in the Trac is still open and I
> couldn't see any related commits.

Well, I'm not using multiple rdbms, so I forgot about it.

I hacked *some* support in multidb branch now for You, could You please test
it?

http://github.com/Almad/django-sane-testing/tree/multidb

API should be same as in Django, so multi_db=True testcase attribute forces
flush on all specified databases.

I don't like how it is done nor how it's tested, but this relates to "multiple
data source resets for test isolation" I have in mind and was planning for
0.6.

If it works, I'll probably release yet another release as 0.5 (also to get
twill support out) and refactor it later. Please let me know if You have some
more complicated setup involving multidb.

I also have to think about "multiple data source API" more, I'll probably post
some thoughts to this list before I'm going to write it. My plan is to start
with it in ~ 2 weeks, but I cannot guarantee anything.


> For example, my settings.py has DATABASES = {....} which is not
> handled by the Django Selenium test runner package.
>

> Also, I have had success beating spam on Google Groups (... *snip*)

Done, thanks. I'll see how big the workload will be.

> Anyway, thanks for the work you've put into this package,

Hope it helps ;)

> Andrew

Almad

andrew cooke

unread,
Sep 18, 2010, 9:50:08 AM9/18/10
to Django: sane testing
Awesome, thanks. I don't actually have any tests yet(!), but I will
try getting started this weekend and report back.

Cheers,
Andrew


On Sep 18, 9:30 am, Almad <b...@almad.net> wrote:
> Hi,
>
> On Saturday 18 of September 2010 12:54:25 andrew cooke wrote:
>
> > Hi,
>
> > Could you clarify whether multiple databases are supported in 1.2?
> > There's a comment athttp://devel.almad.net/trac/django-sane-testing/

andrew cooke

unread,
Sep 18, 2010, 10:05:45 AM9/18/10
to Django: sane testing

I use svn and hg, so this may be me being stupid, but:

(env)pp6 pcl: git help clone
(env)pp6 pcl: git clone http://github.com/Almad/django-sane-testing/tree/multidb
sane
Initialized empty Git repository in /home/andrew/projects/personal/pcl/
sane/.git/
fatal: http://github.com/Almad/django-sane-testing/tree/multidb/info/refs
not found: did you run git update-server-info on the server?

Andrew

Almad

unread,
Sep 18, 2010, 11:10:03 AM9/18/10
to django-sa...@googlegroups.com, andrew cooke
On Saturday 18 of September 2010 16:05:45 andrew cooke wrote:
> I use svn and hg, so this may be me being stupid, but:

Yes, sorry about that. But I plan to migrate dst to my now-usual toolchain
that provides easier (and continuous) releases...and also, github has far
broader community than bitbucket now :(


almad@namtar ~/tmp $ git clone http://github.com/Almad/django-sane-testing.git
Cloning into django-sane-testing...
remote: Counting objects: 807, done.
remote: Compressing objects: 100% (753/753), done.
remote: Total 807 (delta 267), reused 558 (delta 50)
Receiving objects: 100% (807/807), 236.29 KiB | 28 KiB/s, done.
Resolving deltas: 100% (267/267), done.
almad@namtar ~/tmp $ cd django-sane-testing/
almad@namtar ~/tmp/django-sane-testing $ git checkout -b multidb
origin/multidb
Branch multidb set up to track remote branch multidb from origin.
Switched to a new branch 'multidb'
almad@namtar ~/tmp/django-sane-testing $


or You can just

(dist)almad@namtar ~/tmp/dist $ pip install -e
git+http://github.com/Almad/django-sane-
testing.git@multidb#egg=djangosanetesting
Obtaining djangosanetesting from git+http://github.com/Almad/django-sane-
testing.git@multidb#egg=djangosanetesting
Cloning http://github.com/Almad/django-sane-testing.git (to multidb) to
./src/djangosanetesting
Running setup.py egg_info for package djangosanetesting
Installing collected packages: djangosanetesting
Running setup.py develop for djangosanetesting
Creating /home/almad/tmp/dist/lib/python2.6/site-
packages/djangosanetesting.egg-link (link to .)
Adding djangosanetesting 0.5.6 to easy-install.pth file

Installed /home/almad/tmp/dist/src/djangosanetesting
Successfully installed djangosanetesting
Cleaning up...
(dist)almad@namtar ~/tmp/dist $

> Andrew

Almad

andrew cooke

unread,
Sep 18, 2010, 12:22:21 PM9/18/10
to Django: sane testing
OK, that worked thanks. :)

On Sep 18, 11:10 am, Almad <b...@almad.net> wrote:
> On Saturday 18 of September 2010 16:05:45 andrew cooke wrote:
>
> > I use svn and hg, so this may be me being stupid, but:
>
> Yes, sorry about that. But I plan to migrate dst to my now-usual toolchain
> that provides easier (and continuous) releases...and also, github has far
> broader community than bitbucket now :(
>
> almad@namtar ~/tmp $ git clonehttp://github.com/Almad/django-sane-testing.git
> Cloning into django-sane-testing...
> remote: Counting objects: 807, done.
> remote: Compressing objects: 100% (753/753), done.
> remote: Total 807 (delta 267), reused 558 (delta 50)
> Receiving objects: 100% (807/807), 236.29 KiB | 28 KiB/s, done.
> Resolving deltas: 100% (267/267), done.
> almad@namtar ~/tmp $ cd django-sane-testing/
> almad@namtar ~/tmp/django-sane-testing $ git checkout -b multidb
> origin/multidb
> Branch multidb set up to track remote branch multidb from origin.
> Switched to a new branch 'multidb'
> almad@namtar ~/tmp/django-sane-testing $
>
> or You can just
>
> (dist)almad@namtar ~/tmp/dist $ pip install -e
> git+http://github.com/Almad/django-sane-
> testing.git@multidb#egg=djangosanetesting
> Obtaining djangosanetesting from git+http://github.com/Almad/django-sane-
> testing.git@multidb#egg=djangosanetesting
>   Cloninghttp://github.com/Almad/django-sane-testing.git(to multidb) to

andrew cooke

unread,
Sep 18, 2010, 1:11:43 PM9/18/10
to Django: sane testing
Very initial results suggest it does work (it finds a Selenium test
and then skips it as I don't yet have the RC server running).

Only surprise was that it requires that nose be installed (import
fails otherwise).

I'll keep working on this and file a bug report if something breaks.

Cheers,
Andrew


On Sep 18, 11:10 am, Almad <b...@almad.net> wrote:
> On Saturday 18 of September 2010 16:05:45 andrew cooke wrote:
>
> > I use svn and hg, so this may be me being stupid, but:
>
> Yes, sorry about that. But I plan to migrate dst to my now-usual toolchain
> that provides easier (and continuous) releases...and also, github has far
> broader community than bitbucket now :(
>
> almad@namtar ~/tmp $ git clonehttp://github.com/Almad/django-sane-testing.git
> Cloning into django-sane-testing...
> remote: Counting objects: 807, done.
> remote: Compressing objects: 100% (753/753), done.
> remote: Total 807 (delta 267), reused 558 (delta 50)
> Receiving objects: 100% (807/807), 236.29 KiB | 28 KiB/s, done.
> Resolving deltas: 100% (267/267), done.
> almad@namtar ~/tmp $ cd django-sane-testing/
> almad@namtar ~/tmp/django-sane-testing $ git checkout -b multidb
> origin/multidb
> Branch multidb set up to track remote branch multidb from origin.
> Switched to a new branch 'multidb'
> almad@namtar ~/tmp/django-sane-testing $
>
> or You can just
>
> (dist)almad@namtar ~/tmp/dist $ pip install -e
> git+http://github.com/Almad/django-sane-
> testing.git@multidb#egg=djangosanetesting
> Obtaining djangosanetesting from git+http://github.com/Almad/django-sane-
> testing.git@multidb#egg=djangosanetesting
>   Cloninghttp://github.com/Almad/django-sane-testing.git(to multidb) to

Almad

unread,
Oct 15, 2010, 5:39:27 AM10/15/10
to Django: sane testing
On 18 zář, 19:11, andrew cooke <and...@acooke.org> wrote:
> I'll keep working on this and file a bug report if something breaks.

As no bugs were reported, I merged multidb in master and preparing it
for release.

> Cheers,
> Andrew

Regards,

Almad
Reply all
Reply to author
Forward
0 new messages