Re: [Django] #18813: TEST_MIRROR functionality broken for sqlite

2012-10-18 Thread Django
#18813: TEST_MIRROR functionality broken for sqlite
---+--
 Reporter:  adsva  |Owner:  nobody
 Type:  Bug|   Status:  closed
Component:  Testing framework  |  Version:  1.4
 Severity:  Normal |   Resolution:  wontfix
 Keywords: | Triage Stage:  Unreviewed
Has patch:  1  |  Needs documentation:  0
  Needs tests:  0  |  Patch needs improvement:  0
Easy pickings:  0  |UI/UX:  0
---+--
Changes (by lrekucki):

 * status:  new => closed
 * resolution:   => wontfix


Comment:

 If both databases use the same connection, they also share transaction
 state. This isn't what you will get on your production environment.

 As for SQLite, unability to create more then one connection to a
 {{{:memory:}}} database is a known limitation, that can't be solved by
 Django. You can use a file database instead (hint: which you can create on
 a in-memory filesystem for performance).

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to django-updates@googlegroups.com.
To unsubscribe from this group, send email to 
django-updates+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [Django] #18813: TEST_MIRROR functionality broken for sqlite

2012-08-20 Thread Django
#18813: TEST_MIRROR functionality broken for sqlite
---+--
 Reporter:  adsva  |Owner:  nobody
 Type:  Bug|   Status:  new
Component:  Testing framework  |  Version:  1.4
 Severity:  Normal |   Resolution:
 Keywords: | Triage Stage:  Unreviewed
Has patch:  1  |  Needs documentation:  0
  Needs tests:  0  |  Patch needs improvement:  0
Easy pickings:  0  |UI/UX:  0
---+--
Changes (by adsva):

 * component:  Uncategorized => Testing framework
 * needs_better_patch:   => 0
 * type:  Uncategorized => Bug
 * needs_tests:   => 0
 * needs_docs:   => 0


-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to django-updates@googlegroups.com.
To unsubscribe from this group, send email to 
django-updates+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




[Django] #18813: TEST_MIRROR functionality broken for sqlite

2012-08-20 Thread Django
#18813: TEST_MIRROR functionality broken for sqlite
---+
 Reporter:  adsva  |  Owner:  nobody
 Type:  Uncategorized  | Status:  new
Component:  Uncategorized  |Version:  1.4
 Severity:  Normal |   Keywords:
 Triage Stage:  Unreviewed |  Has patch:  1
Easy pickings:  0  |  UI/UX:  0
---+
 I do understand that SQLite doesn't really support replication, so the
 test_mirror setting might be a little silly, but I'm using postgres with a
 master/slave setup in production and would like to use SQLite when running
 the tests for simplicity and performance. Following what seems like a
 somewhat common practice of switching the DATABASES setting for testing:

 {{{
 if 'test' in sys.argv:

 DATABASES = {
 "default": {
 "ENGINE": "django.db.backends.sqlite3",
 },
 "slave": {
 "ENGINE": "django.db.backends.sqlite3",
 'TEST_MIRROR': 'default',
 },
 }

 }}}

 But when I try to use `connections['slave']` after database initialization
 is done in the test runner I get an uninitialized in-memory database, and
 not the `connections['default']` database. The reason seems to be that the
 test runner just copies the name and features of the 'default' connection
 to the 'slave' connection. I guess this is sufficient for the other
 database engines, where the name ensures the connections use the same
 database, but each SQLite connection to ':memory:' gets its own database.

 The attached patch changes that behavior to simply point
 `connections['slave']` to `connections['master']`, and that seems to solve
 the problem, but maybe there was good reason for the current behavior?

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to django-updates@googlegroups.com.
To unsubscribe from this group, send email to 
django-updates+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.