Code

Opened 8 years ago

Closed 8 years ago

#2658 closed defect (fixed)

Test suite fails using SQLite in memory database

Reported by: russellm Owned by: russellm
Component: Database layer (models, ORM) Version: 0.95
Severity: normal Keywords:
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: UI/UX:

Description

Ned Batchelder reports that when using the SQLite backend on [3708], the test_client modeltests closes the database cursor, which causes all the database schema to be lost.

Modifying backends/sqlite3/base.py to the following:

def close(self):
    from django.conf import settings
    if self.connection is not None and settings.DATABASE_NAME != ":memory:":
        self.connection.close()
        self.connection = None

fixes the problem.

Attachments (0)

Change History (1)

comment:1 Changed 8 years ago by russellm

  • Resolution set to fixed
  • Status changed from new to closed

(In [3723]) Fixes #2658 -- Modified SQLite cursor close() method for in-memory databases, making the lifespan of an in-memory database equal to the life of the process, rather than the life of the cursor. Thanks, Ned Batchelder.

Add Comment

Modify Ticket

Change Properties
<Author field>
Action
as closed
as The resolution will be set. Next status will be 'closed'
The resolution will be deleted. Next status will be 'new'
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.