def test_create_and_update(self): component = Component(self.env) component.name = 'Test' component.insert() self.assertEqual([('Test', None, None)], self.env.db_query(""" SELECT name, owner, description FROM component WHERE name='Test'""")) # Use the same model object to update the component component.owner = 'joe' component.update() self.assertEqual([('Test', 'joe', None)], self.env.db_query( "SELECT name, owner, description FROM component WHERE name='Test'"))
def test_create_and_update(self): component = Component(self.env) component.name = "Test" component.insert() cursor = self.db.cursor() cursor.execute("SELECT name,owner,description FROM component " "WHERE name='Test'") self.assertEqual(("Test", None, None), cursor.fetchone()) # Use the same model object to update the component component.owner = "joe" component.update() cursor.execute("SELECT name,owner,description FROM component " "WHERE name='Test'") self.assertEqual(("Test", "joe", None), cursor.fetchone())
def test_create_and_update(self): component = Component(self.env) component.name = 'Test' component.insert() self.assertEqual([('Test', None, None)], self.env.db_query(""" SELECT name, owner, description FROM component WHERE name='Test'""")) # Use the same model object to update the component component.owner = 'joe' component.update() self.assertEqual([('Test', 'joe', None)], self.env.db_query( "SELECT name, owner, description FROM component WHERE name='Test'"))
def test_create_and_update(self): component = Component(self.env) component.name = 'Test' component.insert() cursor = self.db.cursor() cursor.execute("SELECT name,owner,description FROM component " "WHERE name='Test'") self.assertEqual(('Test', None, None), cursor.fetchone()) # Use the same model object to update the component component.owner = 'joe' component.update() cursor.execute("SELECT name,owner,description FROM component " "WHERE name='Test'") self.assertEqual(('Test', 'joe', None), cursor.fetchone())