Commit Graph

49 Commits

Author SHA1 Message Date
Mike Bayer c0b5a0446b - updated the naming scheme of the base test classes in test/testlib/testing.py;
tests extend from either TestBase or ORMTest, using additional mixins for
special assertion methods as needed
2008-02-11 00:28:39 +00:00
Jason Kirtland ed74083956 - Flipped join order of __radd__ on association proxied lists. 2008-01-24 01:12:46 +00:00
Jason Kirtland 412c80dd6c - 2.3 fixup, part two: 100% passing for sqlite
- added 2.4-style binops to util.Set on 2.3
  - OrderedSets pickle on 2.3
  - more lib/sqlalchemy set vs Set corrections
  - fixed InstrumentedSet.discard for 2.3
  - set, sorted compatibility for test suite
- added testing.fails_if decorator
2008-01-21 23:19:39 +00:00
Jason Kirtland 17d3c8764e - testbase is gone, replaced by testenv
- Importing testenv has no side effects- explicit functions provide similar behavior to the old immediate behavior of testbase
- testing.db has the configured db
- Fixed up the perf/* scripts
2008-01-12 22:03:42 +00:00
Jason Kirtland bf36c648f2 Reworked r4042- undeclared deprecation warnings are now *fatal* to tests. No surprises. 2008-01-10 02:37:39 +00:00
Jason Kirtland 84576e3258 test suite deprecation rampage 2008-01-09 22:54:51 +00:00
Jason Kirtland 912432179a Silenced deprecation warnings when testing deprecated extensions... 2008-01-09 20:41:14 +00:00
Jason Kirtland 4c705b6089 Added explicit length to more testing String columns. 2008-01-09 20:29:04 +00:00
Jason Kirtland 2bc1c28c44 More overloads: fix cascades for += on a list relation, added operator support to association proxied lists. 2008-01-05 19:11:58 +00:00
Jason Kirtland a230391a37 Fixed in-place set mutation operator support [ticket:920] 2008-01-04 20:17:42 +00:00
Jason Kirtland 273e48c9a9 - Raise an error when assigning a bogusly keyed dictionary to one of the builtin dict-based collection types [ticket:886]
- Collections gain a @converter framework for flexible validation and adaptation of bulk assignment
- Bogus bulk assignments now raise TypeError instead of exceptions.ArgumentError
2007-12-14 00:13:18 +00:00
Mike Bayer 2e9501683d - session checks more carefully when determining "object X already in another session";
e.g. if you pickle a series of objects and unpickle (i.e. as in a Pylons HTTP session
or similar), they can go into a new session without any conflict
- added stricter checks around session.delete() similar to update()
- shored up some old "validate" stuff in session/uow
2007-11-01 20:12:36 +00:00
Jason Kirtland 52d5151aa4 - Removed unused util.hash()
- Fixed __hash__ for association proxy collections
2007-10-31 03:25:04 +00:00
Jason Kirtland 259b256759 - Don't re-save objects in these tests (post r3681) 2007-10-31 03:17:51 +00:00
Jason Kirtland d433ec4f0d Changed some columns from TEXT to VARCHAR for sapdb. 2007-10-22 23:01:02 +00:00
Paul Johnston a0ed498ff5 Fix ActiveMapper unit tests 2007-10-13 00:01:11 +00:00
Jason Kirtland fba14f6047 from foo import (name, name) isn't valid syntax for 2.3. ah well.
omitting modules from sqlalchemy.__all__...
2007-08-21 22:20:52 +00:00
Mike Bayer 109d535961 - method call removal 2007-08-20 21:50:59 +00:00
Mike Bayer ed4fc64bb0 merging 0.4 branch to trunk. see CHANGES for details. 0.3 moves to maintenance branch in branches/rel_0_3. 2007-07-27 04:08:53 +00:00
Jason Kirtland 177d30cc01 - Deprecated DynamicMetaData- use ThreadLocalMetaData or MetaData instead
- Deprecated BoundMetaData- use MetaData instead
- Removed DMD and BMD from documentation
2007-07-06 00:58:09 +00:00
Jason Kirtland 6cd584d303 - Fixed typo blocking some assoc proxy dict assignments, added test 2007-06-16 22:04:13 +00:00
Jason Kirtland 84420a1d0f - Iteration over dict association proxies is now dict-like, not
InstrumentedList-like (e.g. over keys instead of values).
- Don't tightly bind proxies to source collections (fixes #597)
- Handle slice objects on orderinglist's __setitem__
2007-06-14 00:11:51 +00:00
Jason Kirtland 76a1d1276c Oops, Python 2.5 ternary operator snuck in. 2007-05-03 21:51:34 +00:00
Jason Kirtland 5606c01d39 - Test assoc proxy lazy loads, fixed __set__ race on single scalar assocs 2007-05-03 18:22:31 +00:00
Jason Kirtland 300d1d2c13 - New association proxy implementation, implementing complete proxies to list, dict and set-based relation collections (and scalar relations). Extensive tests.
- Added util.duck_type_collection
2007-05-03 00:57:59 +00:00
Jason Kirtland bb7a29d622 - added sqlalchemy.ext.orderinglist, a custom list class that synchronizes an object attribute with that object's position in the list 2007-05-02 20:17:31 +00:00
Rick Morrison 0a09256619 mssql: now passes still more unit tests, [ticket:481] 2007-03-19 02:00:32 +00:00
Mike Bayer c249066dbf "alltests" runners call testbase.main(), which takes an optional suite,
so that exit code is propigated
2007-03-15 18:11:05 +00:00
Rick Morrison 30b20e3c56 MSSQL now passes still more unit tests [ticket:481]
Fix to null FLOAT fields in mssql-trusted.patch
MSSQL: LIMIT with OFFSET now raises an error
MSSQL: can now specify Windows authorization
MSSQL: ignores seconds on DATE columns (DATE fix, part 1)
2007-03-15 02:31:15 +00:00
Mike Bayer b2e04755cc - the full featureset of the SelectResults extension has been merged
into a new set of methods available off of Query.  These methods
all provide "generative" behavior, whereby the Query is copied
and a new one returned with additional criterion added.
The new methods include:

  filter() - applies select criterion to the query
  filter_by() - applies "by"-style criterion to the query
  avg() - return the avg() function on the given column
  join() - join to a property (or across a list of properties)
  outerjoin() - like join() but uses LEFT OUTER JOIN
  limit()/offset() - apply LIMIT/OFFSET
  range-based access which applies limit/offset:
     session.query(Foo)[3:5]
  distinct() - apply DISTINCT
  list() - evaluate the criterion and return results

no incompatible changes have been made to Query's API and no methods
have been deprecated.  Existing methods like select(), select_by(),
get(), get_by() all execute the query at once and return results
like they always did.  join_to()/join_via() are still there although
the generative join()/outerjoin() methods are easier to use.

- the return value for multiple mappers used with instances() now returns
a cartesian product of the requested list of mappers, represented
as a list of tuples.  this corresponds to the documented behavior.
So that instances match up properly, the "uniquing" is disabled when
this feature is used.
- strings and columns can also be sent to the *args of instances() where
those exact result columns will be part of the result tuples.
- query() method is added by assignmapper.  this helps with
navigating to all the new generative methods on Query.
2007-03-10 02:49:12 +00:00
Mike Bayer 231acabf72 - options() method on SelectResults now implemented "generatively"
like the rest of the SelectResults methods [ticket:472]
2007-03-07 01:31:41 +00:00
Mike Bayer 142d3f4bfd added unit tests illustrating current workaround for assignmapper method name/collection class collision 2007-01-24 22:43:25 +00:00
Mike Bayer b6b0130646 - made kwargs parsing to Table strict; removed various obsoluete "redefine=True" kw's from the unit tests
- documented instance variables in ANSICompiler
- fixed [ticket:120], adds "inline_params" set to ANSICompiler which DefaultDialect picks up on when
determining defaults.  added unittests to query.py
- additionally fixed up the behavior of the "values" parameter on _Insert/_Update
- more cleanup to sql/Select - more succinct organization of FROM clauses, removed silly _process_from_dict
methods and JoinMarker object
2006-11-26 02:36:27 +00:00
Mike Bayer 19fcb943c4 - cleanup on some instance vars in Select (is_scalar, is_subquery, _froms is __froms, removed unused 'nowait', '_text', etc)
- cleaned up __repr__ on Column, AbstractTypeEngine
- added standalone intersect(_all), except(_all) functions, unit tests illustrating nesting patterns [ticket:247]
2006-11-25 21:32:26 +00:00
Mike Bayer aeb8c429bf - implemented from_obj argument for query.count, improves count function
on selectresults [ticket:325]
2006-11-02 21:31:56 +00:00
Mike Bayer 97feb4dbee - docstring on polymorphic_mapping
- applied Simon Wittber's ActiveMapper version_id_col patch for [ticket:348]
2006-10-21 23:15:13 +00:00
Mike Bayer 180d374199 reorganizing classnames a bit, flagging "private" classes in the sql package,
getting the generated docs to look a little nicer.
fixes to extensions, sqlsoup etc. to be compatible with recent API tweaks
2006-10-17 02:03:00 +00:00
Mike Bayer a81bd92d6e - specifying joins in the from_obj argument of query.select() will
replace the main table of the query, if the table is somewhere within
the given from_obj.  this makes it possible to produce custom joins and
outerjoins in queries without the main table getting added twice.
[ticket:315]
- added join_to and outerjoin_to transformative methods to SelectResults,
to build up join/outerjoin conditions based on property names. also
added select_from to explicitly set from_obj parameter.
- factored "results" arrays from the mapper test suite and into the
"tables" mapper
- added "viewonly" param to docs
2006-09-27 07:08:26 +00:00
Mike Bayer 8f41fed5a2 - moved selectresults test from orm to ext package
- renamed objectstore test suite to unitofwork
- added additional "eagerdegrade" tests to mapper, to test fixes from #308
2006-09-22 00:33:44 +00:00
Mike Bayer 4b73f0859f added an objectstore clear 2006-08-09 23:56:29 +00:00
Mike Bayer af59af2359 added start of a many-to-many test 2006-08-07 05:10:59 +00:00
Jonathan Ellis 6fed7d0166 fix doctest integration 2006-07-21 16:44:01 +00:00
Mike Bayer 70469bf260 added count/count_by to assignmapper, plus a test in activemapper to try it out 2006-07-13 16:36:31 +00:00
Mike Bayer 7d91bebccc sqlite detects version and disables CAST if version < 3.2.3
fixes to unittests, mapper extension to work better with setting/unsetting extensions
objectstore objects get 'session' attribute
2006-07-11 00:36:32 +00:00
Mike Bayer 5c7993080a some refactorings to activemapper, made relationship() class have some polymorphic behavior for initializing its real relation, added support + unittest for self-referential relationship 2006-07-09 19:48:02 +00:00
Jonathan LaCour 4e3aa8829a There were two significant changes in this commit:
* Added implicit primary keys to ActiveMapper.  Now, if you do not speicfy a
   primary key on your objects when declaring them, an Integer primary key
   called `id` will automatically be added to your objects for you.

 * Commented out a large chunk of the process_relationships function that
   should no longer be necessary thanks to some of the deferred mapper
   compilation that was added in SQLAlchemy 0.2.3.  I left it in the code, but
   commented it out just in case this change causes a problem in someone's
   else's code and I can put it back in if needed.
2006-06-29 23:29:37 +00:00
Mike Bayer b3927fbb88 inserting './lib/' into sys.path since PYTHONPATH no longer straightforward with latest setuptools 2006-06-29 00:28:55 +00:00
Jonathan LaCour 70b2dec19a Updated ActiveMapper to support order_by parameters on all relationships.
Thanks to Charles Duffy for this patch!
2006-06-28 17:26:48 +00:00
Mike Bayer 120dcee5a7 reorganized unit tests into subdirectories 2006-06-05 17:25:51 +00:00