Show
Ignore:
Timestamp:
09/29/09 18:53:07 (3 years ago)
Author:
ged
Message:

- Default table_options (defined in options_defaultstable_options?) are now

also used for ManyToMany tables.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • elixir/trunk/tests/test_m2m.py

    r477 r478  
    5858    def test_table_kwargs(self): 
    5959        class A(Entity): 
    60             using_options(shortnames=True) 
    61             name = Field(String(60)) 
    6260            bs_ = ManyToMany('B', table_kwargs={'info': {'test': True}}) 
    6361 
    6462        class B(Entity): 
    65             using_options(shortnames=True) 
    66             name = Field(String(60)) 
    6763            as_ = ManyToMany('A') 
    6864 
     
    7167 
    7268        assert A.bs_.property.secondary.info['test'] is True 
     69 
     70    def test_table_default_kwargs(self): 
     71        options_defaults['table_options'] = {'info': {'test': True}} 
     72 
     73        class A(Entity): 
     74            bs_ = ManyToMany('B') 
     75 
     76        class B(Entity): 
     77            as_ = ManyToMany('A') 
     78 
     79        setup_all(True) 
     80        A.mapper.compile() 
     81 
     82        options_defaults['table_options'] = {} 
     83 
     84        assert A.bs_.property.secondary.info['test'] is True 
     85        assert A.table.info['test'] is True 
     86        assert B.table.info['test'] is True 
    7387 
    7488    def test_custom_global_column_nameformat(self):