Пример #1
0
 def test_can_be_upserted_in_a_transaction(self):
     self.make_package(description='Before')
     with self.db.get_cursor() as cursor:
         Package.upsert(NPM,
                        name='foo',
                        description='After',
                        emails=[],
                        cursor=cursor)
         assert Foo().description == 'Before'
     assert Foo().description == 'After'
Пример #2
0
 def test_can_be_upserted_in_a_transaction(self):
     self.make_package(description='Before')
     with self.db.get_cursor() as cursor:
         Package.upsert(NPM, name='foo', description='After', emails=[], cursor=cursor)
         assert Foo().description == 'Before'
     assert Foo().description == 'After'
Пример #3
0
 def test_can_be_updated_via_upsert(self):
     self.make_package()
     Package.upsert(NPM, name='foo', description='Bar!', emails=[])
     assert Foo().description == 'Bar!'
Пример #4
0
 def test_can_be_inserted_via_upsert(self):
     Package.upsert(NPM, name='foo', description='Foo!', emails=[])
     assert Foo().name == 'foo'