Changeset 245

Show
Ignore:
Timestamp:
10/26/07 12:01:04 (6 years ago)
Author:
ged
Message:

made all tests work even if we changed autosetup to default to False. That is,

call setup_all wherever it is necessary.

Location:
elixir/trunk/tests
Files:
12 modified

Legend:

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

    r225 r245  
    2828            using_mapper_options(primary_key=['id']) 
    2929 
     30        setup_all() 
     31 
    3032        barney = Person(id=1, name="Barney") 
    3133 
  • elixir/trunk/tests/test_autosetup.py

    r234 r245  
    6464        class Person(Entity): 
    6565            name = Field(Unicode(30)) 
    66             using_options(tablename='person') 
     66            using_options(autosetup=True, tablename='person') 
    6767 
    6868        assert 'person' in metadata.tables 
     
    7373        class Person(Entity): 
    7474            name = Field(Unicode(30)) 
    75             using_options(tablename='person') 
     75            using_options(autosetup=True, tablename='person') 
    7676 
    7777        tablename = Person.table.name 
     
    8282        class Person(Entity): 
    8383            name = Field(Unicode(30)) 
    84             using_options(tablename='person') 
     84            using_options(autosetup=True, tablename='person') 
    8585 
    8686        create_all() 
     
    9090        class Person(Entity): 
    9191            name = Field(Unicode(30)) 
    92             using_options(tablename='person') 
     92            using_options(autosetup=True, tablename='person') 
    9393 
    9494        setup_all() 
     
    9898        class Person(Entity): 
    9999            name = Field(Unicode(30)) 
    100             using_options(tablename='person') 
     100            using_options(autosetup=True, tablename='person') 
    101101 
    102102        q = Person.query 
  • elixir/trunk/tests/test_encryption.py

    r234 r245  
    2929class TestEncryption(object): 
    3030    def setup(self): 
    31         create_all() 
     31        setup_all(True) 
    3232     
    3333    def teardown(self): 
     
    5454 
    5555        p = Person.get_by(name='Jonathan LaCour') 
     56        print p.password 
    5657        assert p.password == 's3cr3tw0RD' 
    5758        assert p.ssn == '123-45-6789' 
  • elixir/trunk/tests/test_events.py

    r234 r245  
    5757    metadata.bind = 'sqlite:///' 
    5858 
     59    setup_all() 
     60 
    5961 
    6062def teardown(): 
  • elixir/trunk/tests/test_m2m.py

    r234 r245  
    6969            friends = ManyToMany('Person') 
    7070 
    71         create_all() 
     71        setup_all(True) 
    7272 
    7373        barney = Person(name="Barney") 
  • elixir/trunk/tests/test_nestedclass.py

    r234 r245  
    1 from elixir import Entity, Field, String 
     1from elixir import * 
    22 
    33def setup(): 
     
    1313         
    1414        other = Field(String(40)) 
     15         
     16    setup_all()         
    1517     
    1618class TestNestedClass(object): 
    1719    def test_nestedclass(self): 
     20 
    1821        print "GLOBALS", globals().keys() 
    1922        assert 'name' in Thing.table.columns.keys() 
  • elixir/trunk/tests/test_o2m.py

    r234 r245  
    8989                return s 
    9090 
    91         create_all() 
     91        setup_all(True) 
    9292 
    9393        node2 = TreeNode(name='node2') 
  • elixir/trunk/tests/test_options.py

    r234 r245  
    2222            using_options(version_id_col=True) 
    2323  
     24        setup_all() 
    2425        Person.table.create() 
    2526  
     
    6263        options_defaults['tablename'] = camel_to_underscore 
    6364 
    64         setup_all(True) 
    65  
    6665        class MyEntity(Entity): 
    6766            name = Field(Unicode(30)) 
     
    9796            surname = Field(Unicode(30)) 
    9897 
     98        setup_all() 
    9999        create_all(engine) 
    100100 
     
    114114            surname = Field(Unicode(30)) 
    115115 
     116        setup_all() 
    116117        create_all(engine) 
    117118 
     
    155156            surname = Field(Unicode(30)) 
    156157 
     158        setup_all() 
    157159        create_all(engine) 
    158160 
     
    181183            surname = Field(Unicode(30)) 
    182184 
     185        setup_all() 
    183186        create_all(engine) 
    184187 
     
    208211            surname = Field(Unicode(30)) 
    209212 
     213        setup_all() 
    210214        create_all(engine) 
    211215 
     
    234238            using_table_options(UniqueConstraint('firstname', 'surname')) 
    235239 
    236         create_all() 
     240        setup_all(True) 
    237241 
    238242        homer = Person(firstname="Homer", surname='Simpson') 
  • elixir/trunk/tests/test_order_by.py

    r234 r245  
    3030 
    3131    metadata.bind = 'sqlite:///' 
    32     create_all() 
     32    setup_all(True) 
    3333 
    3434    # insert some data 
  • elixir/trunk/tests/test_packages.py

    r234 r245  
    1818        # all modules, including a and b. Then when any other test calls 
    1919        # setup_all(), A and B are also setup, but then the other test also 
    20         # calls cleanup_all(), so when we get here, A and B are already dead and 
    21         # reimporting their modules does nothing because they were already 
     20        # calls cleanup_all(), so when we get here, A and B are already dead  
     21        # and reimporting their modules does nothing because they were already 
    2222        # imported. 
    2323        sys.modules.pop('tests.a', None) 
  • elixir/trunk/tests/test_properties.py

    r243 r245  
    1010 
    1111 
    12 class TestHasProperty(object): 
     12class TestSpecialProperties(object): 
    1313    def teardown(self): 
    1414        cleanup_all() 
     
    3636            has_many('tags', of_kind='Tag', lazy=False)  
    3737 
    38         create_all() 
     38        setup_all(True) 
    3939 
    4040        u1 = User(name='joe', tags=[Tag(score1=5.0, score2=3.0),  
  • elixir/trunk/tests/test_versioning.py

    r234 r245  
    3232        using_options(tablename='actors') 
    3333 
     34    setup_all() 
    3435    metadata.bind = 'sqlite:///' 
    3536