Sunday, October 26, 2014

Re: TEST_MIRROR not working?

On Sat, Oct 25, 2014 at 5:21 PM, Ilya Baryshev <baryshev@gmail.com> wrote:
> Hey all!
>
> I was writing tests for queries that use replica database, so I tried using
> TEST_MIRROR setting.
> TEST_MIRROR promises "connection to slave will be redirected to point at
> default.
> As a result, writes to default will appear on slave". Which happens not to
> be the case for me,
> replica queries are not returning expected results.
>
> Is this a bug, or am I missing something?
>
> Here is my example settings:
>
> DATABASES = {
> 'default': {
> 'ENGINE': 'django.db.backends.postgresql_psycopg2',
> 'NAME': 'testmirror',
> 'HOST': '127.0.0.1',
> 'PORT': 5432,
> },
> 'slave': {
> 'ENGINE': 'django.db.backends.postgresql_psycopg2',
> 'NAME': 'testmirror2',
> 'HOST': '127.0.0.1',
> 'PORT': 5432,
> 'TEST': {
> 'MIRROR': 'default'

This should be 'TEST_MIRROR': 'default'

Cheers

Tom

--
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+unsubscribe@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.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CAFHbX1L%3DU95K4_XreTm%3D2aET3JRPCCeQL1773wgRZ_25eJX7gQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment