Commit Graph

59 Commits

Author SHA1 Message Date
Mike Bayer be40b51cb0 getting everything to pass again 2012-09-27 16:33:54 -04:00
Mike Bayer 20cdc64588 trying different approaches to test layout. in this one, the testing modules
become an externally usable package but still remains within the main sqlalchemy parent package.
in this system, we use kind of an ugly hack to get the noseplugin imported outside of the
"sqlalchemy" package, while still making it available within sqlalchemy for usage by
third party libraries.
2012-09-27 02:37:33 -04:00
Mike Bayer 3e55ed778b - [feature] Connection event listeners can
now be associated with individual
Connection objects, not just Engine
objects.  [ticket:2511]
2012-07-18 20:23:01 -04:00
Mike Bayer 0efac1d93e - move all of orm to use absolute imports
- break out key mechanics of loading objects
into new "orm.loading" module, removing implementation
details from both mapper.py and query.py. is analogous
to persistence.py
- some other cleanup and old cruft removal
2012-06-23 14:45:47 -04:00
Mike Bayer 6c03a8ddd3 - add __table_cls__ option to declarative, not publicized yet, is for the moment
for the benefit of the test.lib.schema package.
- use test.lib.schema.Table for the table within test.lib.fixtures.DeclarativeMappedTest
- [bug] Removed the check for number of
rows affected when doing a multi-delete
against mapped objects.   If an ON DELETE
CASCADE exists between two rows, we can't
get an accurate rowcount from the DBAPI;
this particular count is not supported
on most DBAPIs in any case, MySQLdb
is the notable case where it is.
[ticket:2403]
2012-03-12 13:14:14 -07:00
Mike Bayer 1f057987da - [bug] Scaled back the test applied within
flush() to check for UPDATE against partially
NULL PK within one table to only actually
happen if there's really an UPDATE to occur.
[ticket:2390]
2012-01-30 17:52:28 -05:00
Mike Bayer c9a1e570ad - rework the test suite to make use of SkipTest for tests skipped, unsupported, etc.
so that we can get an accurate picture what's really running/not, what's installed on jenkins, etc.
Tested in cpython 2.7 so far, we'll see what jenkins says about other platforms
2012-01-22 13:19:22 -05:00
Mike Bayer f07ffb4739 - Added new flag expire_on_flush=False to column_property(),
marks those properties that would otherwise be considered
    to be "readonly", i.e. derived from SQL expressions,
    to retain their value after a flush has occurred, including
    if the parent object itself was involved in an update.
2011-10-11 14:15:09 -04:00
Mike Bayer a0cc36c239 - adjust some tests and such to work better with a mysql 5.5 install
- Added mysql_length parameter to Index construct,
    specifies "length" for indexes.  [ticket:2293]
2011-10-11 00:15:43 -04:00
Mike Bayer d9a2c64a41 - Modify the text of the message which occurs
when the "identity" key isn't detected on
flush, to include the common cause that
the Column isn't set up to detect
auto-increment correctly; [ticket:2170].
Also in 0.6.8.
2011-06-04 20:04:29 -04:00
Mike Bayer 1da499a838 - Added checks inside the UOW to detect the unusual
condition of being asked to UPDATE or DELETE
on a primary key value that contains NULL
in it.  [ticket:2127]

- Some refinements to attribute history.  More
changes are pending possibly in 0.8, but
for now history has been modified such that
scalar history doesn't have a "side effect"
of populating None for a non-present value.
This allows a slightly better ability to
distinguish between a None set and no actual
change, affects [ticket:2127] as well.

- rewriting the history tests in test_attributes to be
individual per operation/assertion.   its a huge job
so this is partial for the moment.
2011-04-10 20:22:11 -04:00
Mike Bayer 7b24e458c7 - move all the comments that got shoved below the fixture grabs back up 2011-03-27 17:19:00 -04:00
Mike Bayer 68a350d462 - remove test.sql._base, test.engine._base, test.orm._base, move those classes to a new test.lib.fixtures module
- move testing.TestBase to test.lib.fixtures
- massive search and replace
2011-03-27 16:27:27 -04:00
Mike Bayer a3083eabf4 - move all the setup_classes(cls) and setup_mappers(cls) to use a
local cls.Basic, cls.Comparable base class so that there is no ambiguity
or hash identity behaviors getting in the way of class registration.
2011-03-27 15:04:06 -04:00
Mike Bayer 14a2fae239 - remove @testing.resolve_artifact_names, replace with direct attribute
access to the cls/self.tables/classes registries
- express orm/_base.py ORMTest in terms of engine/_base.py TablesTest,
factor out common steps into TablesTest, remove AltEngineTest as a
separate class.   will further consolidate these base classes
2011-03-26 19:03:11 -04:00
Diana Clarke 13242f766e corrected a bunch of spelling typos 2011-02-28 13:17:46 -05:00
Mike Bayer 848a56ea57 - Fixed bug whereby "passive_deletes='all'" wasn't passing
the correct symbols to lazy loaders during flush, thereby
causing an unwarranted load.  [ticket:2013]
2011-01-04 10:55:46 -05:00
Mike Bayer 350aed3fdb - whitespace removal bonanza 2011-01-02 14:23:42 -05:00
Mike Bayer 426c4356eb - removes the "on_" prefix. 2010-12-30 14:22:43 -05:00
Mike Bayer b1c90de449 - mutable examples now move into sqlalchemy.ext.mutable
- streamline interfaces, get Mutable/MutableComposite to be as minimal
in usage as possible
- docs for mutable, warnings regrarding mapper events being global
- move MutableType/mutable=True outwards, move orm tests to its
own module, note in all documentation
- still need more events/tests for correct pickling support of
composites, mutables.  in the case of composites its needed
even without mutation.  see [ticket:2009]
2010-12-29 15:04:35 -05:00
Mike Bayer d30678d18d new calling style: event.listen(target, identifier, fn) 2010-12-01 14:10:11 -05:00
Mike Bayer 58b2939433 - sqlalchemy.test and nose plugin moves back to being entirely
outside of "sqlalchemy" and under "test/".

Rationale:

- coverage plugin works without issue, without need for an awkward
additional package install
- command line for "nosetests" isn't polluted with SQLAlchemy options

[ticket:1949]
2010-11-28 14:19:44 -05:00
Mike Bayer 94bb2f428e - a column with a "mutable" type mapped as "deferred" will not
emit a load for the "old" value upon a set event,
unless the "active_history" flag is set to True.  [ticket:1976]
2010-11-28 13:45:51 -05:00
Mike Bayer d14d171772 - the "mutable" flag on PickleType, postgresql.ARRAY is now off
by default.  [ticket:1980]
2010-11-28 12:16:39 -05:00
Mike Bayer f1e4718f79 - merge mapper simpler compile branch, [ticket:1966] 2010-11-26 16:28:41 -05:00
Mike Bayer d505ea71ae - merge events branch, [ticket:1902] 2010-11-20 11:39:44 -05:00
Mike Bayer 4af7bc6cfc - modernize MutableTypesTest, add tests for expired/deferred to establish 0.6 behavior
regarding [ticket:1976]
2010-11-19 18:49:06 -05:00
Mike Bayer e1402efb19 - move sqlalchemy.test to test.lib 2010-11-15 19:37:50 -05:00
Mike Bayer 20ad3b16e8 [ticket:1966] implementation 2010-11-15 19:05:23 -05:00
Mike Bayer 3564ea86e7 - move deprecated interfaces down to bottom of TOC, update verbiage
- more docs for engine, pool, DDL events
- update DDL sequences documentation to use events
- update DDL() docstring to refer to execute_if()
- document parameters for DDLElement.execute_if()
- add retval=True flag to Engine.on_before_execute(), on_before_cursor_execute().
wrap the function if retval=False, check for appropriate usage of the flag, add
tests.
- remove ScopedSession.mapper and tests entirely
- remove ExtensionCarrier and tests
- change remaining tests that use MapperExtension to use MapperEvents
2010-11-10 19:00:28 -05:00
Mike Bayer 4e2c0f10cd - merge tip 2010-11-06 11:49:45 -04:00
Mike Bayer 0d00f47035 - Fixed bug whereby a non-"mutable" attribute modified event
which occurred on an object that was clean except for
preceding mutable attribute changes would fail to strongly
reference itself in the identity map. This would cause the
object to be garbage collected, losing track of any changes
that weren't previously saved in the "mutable changes"
dictionary.
2010-10-26 16:12:04 -04:00
Mike Bayer 60b82d6e13 - merge tip, 0.6.4 + 0.6.5 2010-09-14 17:37:27 -04:00
Mike Bayer bad4493842 - Slight improvement to the behavior of "passive_updates=False"
when placed only on the many-to-one side of a
    relationship; documentation has been clarified
    that passive_updates=False should really be on the
    one-to-many side.

  - Placing passive_deletes=True on a many-to-one emits
    a warning, since you probably intended to put it on
    the one-to-many side.
2010-09-12 12:37:43 -04:00
Mike Bayer 9674b4bf17 - collection docs
- Added an assertion during flush which ensures
that no NULL-holding identity keys were generated
on "newly persistent" objects.
This can occur when user defined code inadvertently
triggers flushes on not-fully-loaded objects.
2010-09-09 19:21:23 -04:00
Mike Bayer a1d9c824da getting attributes to work 2010-08-08 19:36:07 -04:00
Mike Bayer 4c87fb7613 - Fixed regression introduced in 0.6.0 involving improper
history accounting on mutable attributes.  Essentially
reversing r6b2b4fcd4799 and getting it covered.
[ticket:1782]
2010-04-26 16:55:11 -04:00
Mike Bayer 9df8afc600 - cleanup, factoring, had some heisenbugs. more test coverage
will be needed overall as missing dependency rules lead
to subtle bugs pretty easily
2010-04-06 01:23:54 -04:00
Mike Bayer 5c758932a5 - Restored some bind-labeling logic from 0.5 which ensures
that tables with column names that overlap another column
of the form "<tablename>_<columnname>" won't produce
errors if column._label is used as a bind name during
an UPDATE.  Test coverage which wasn't present in 0.5
has been added.  [ticket:1755]
2010-03-31 13:01:40 -04:00
Mike Bayer c6bceb7775 - converted all lazy=True|False|None to 'select'|'joined'|'noload'
- converted all eager to joined in examples
- fixed beaker/advanced.py to reference RelationshipCache
2010-03-24 19:19:03 -04:00
Mike Bayer 1675811029 - To accomodate the fact that there are now two kinds of eager
loading available, the new names for eagerload() and
eagerload_all() are joinedload() and joinedload_all().  The
old names will remain as synonyms for the foreseeable future.

- The "lazy" flag on the relationship() function now accepts
a string argument for all kinds of loading: "select", "joined",
"subquery", "noload" and "dynamic", where the default is now
"select".  The old values of True/
False/None still retain their usual meanings and will remain
as synonyms for the foreseeable future.

- Added documentation to tutorial,mapper doc, api docs
for subqueryload, subqueryload_all, and other options.
2010-03-24 19:11:01 -04:00
Mike Bayer 065fcbd9d2 - The official name for the relation() function is now
relationship(), to eliminate confusion over the relational
algebra term.  relation() however will remain available
in equal capacity for the foreseeable future.  [ticket:1740]
2010-03-17 17:48:29 -04:00
Mike Bayer 84c6857d21 - Fixed bug which caused "row switch" logic, that is an
INSERT and DELETE replaced by an UPDATE, to fail when
version_id_col was in use. [ticket:1692]

- Added "version_id_generator" argument to Mapper, this is a
callable that, given the current value of the "version_id_col",
returns the next version number.  Can be used for alternate
versioning schemes such as uuid, timestamps.  [ticket:1692]
2010-03-16 12:58:13 -04:00
Mike Bayer 20d6baa09f more py3k fixes 2010-02-20 23:02:08 +00:00
Mike Bayer 95096847d8 get tests to pass for OurSQL 2010-02-15 23:59:42 +00:00
Mike Bayer c1e0978556 - Primary key values can now be changed on a joined-table inheritance
object, and ON UPDATE CASCADE will be taken into account when
the flush happens.  Set the new "passive_updates" flag to False
on mapper() when using SQLite or MySQL/MyISAM. [ticket:1362]

- flush() now detects when a primary key column was updated by
an ON UPDATE CASCADE operation from another primary key, and
can then locate the row for a subsequent UPDATE on the new PK
value.  This occurs when a relation() is there to establish
the relationship as well as passive_updates=True.  [ticket:1671]
2010-02-02 22:56:19 +00:00
Mike Bayer 6a0fa04c58 remove my comment. still wish this could be done in a cleaner way tho 2010-01-25 00:41:55 +00:00
Philip Jenvey c0835ffdc2 revert r6686 and adjust the stacklevel of test_notsane_warning's SAWarning so
it can force it to be emitted
2010-01-25 00:32:47 +00:00
Mike Bayer d3e49722d1 query 2010-01-24 21:42:21 +00:00
Philip Jenvey 8bdf8b3a94 test_notsane_working needs to run first for dialects that don't
supports_sane_rowcount so the other VersioningTests don't ignore the warning it
expects (that ignore lasts forever)
2010-01-24 21:32:09 +00:00