﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
23718	TEST_MIRROR setting doesn't work as expected (and has no tests)	Ilya Baryshev	Sarah Boyce	"TEST_MIRROR promises ""connection to slave will be redirected to point at default. As a result, writes to default will appear on slave""
I've set up a minimum django project (using postgres backed) to demonstrate behavior.

{{{

    def test_fixture(self):
        MyModel.objects.using('default').create(name=1)
        MyModel.objects.using('slave').create(name=2)
        MyModel.objects.using('slave').create(name=3)
        self.assertEqual(list(map(repr, MyModel.objects.using('default').all())),
                         list(map(repr, MyModel.objects.using('slave').all())))
}}}

Both lists should be equal, because replica queries should be hitting default instead.
It appears not to be the case for Django>=1.4 up to latest 1.7.1 (but actually passes against 1.3.7)

{{{
AssertionError: Lists differ: ['<MyModel: 1>', '<MyModel: 2>... != ['<MyModel: 2>', '<MyModel: 3>...

First differing element 0:
<MyModel: 1>
<MyModel: 2>

First list contains 1 additional elements.
First extra element 2:
<MyModel: 3>

- ['<MyModel: 1>', '<MyModel: 2>', '<MyModel: 3>']
?             ^               ----------------

+ ['<MyModel: 2>', '<MyModel: 3>']
?             ^
}}}

Here is a project I used to test: https://github.com/coagulant/test_mirror"	Bug	closed	Documentation	1.7	Normal	fixed	replica testing	Carlton Gibson Patrick Cloke	Ready for checkin	1	0	0	0	0	0
