mirror of
https://github.com/psycopg/psycopg2.git
synced 2024-11-10 19:16:34 +03:00
Merge remote-tracking branch 'fix_lobject_factory'
This commit is contained in:
commit
a7e3f46431
|
@ -938,7 +938,7 @@ psyco_conn_lobject(connectionObject *self, PyObject *args, PyObject *keywds)
|
|||
PyObject *obj;
|
||||
|
||||
static char *kwlist[] = {"oid", "mode", "new_oid", "new_file",
|
||||
"cursor_factory", NULL};
|
||||
"lobject_factory", NULL};
|
||||
|
||||
if (!PyArg_ParseTupleAndKeywords(args, keywds, "|IzIzO", kwlist,
|
||||
&oid, &smode, &new_oid, &new_file,
|
||||
|
|
|
@ -389,6 +389,13 @@ class LargeObjectTests(LargeObjectTestCase):
|
|||
except psycopg2.OperationalError:
|
||||
pass
|
||||
|
||||
def test_factory(self):
|
||||
class lobject_subclass(psycopg2.extensions.lobject):
|
||||
pass
|
||||
|
||||
lo = self.conn.lobject(lobject_factory=lobject_subclass)
|
||||
self.assert_(isinstance(lo, lobject_subclass))
|
||||
|
||||
decorate_all_tests(LargeObjectTests, skip_if_no_lo, skip_lo_if_green)
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user