Example #1
0
 def test_insert(self):
     report = Report(self.env)
     report.title = "The report"
     report.description = "The description"
     report.query = "SELECT 1"
     report.insert()
     self.assertEqual(9, report.id)
Example #2
0
    def test_update(self):
        report = Report(self.env, 1)
        title, description, query = \
            report.title, report.description, report.query
        report.title = "The report"
        report.description = "The description"
        report.query = "SELECT 1"
        report.update()

        report = Report(self.env, 1)
        self.assertNotEqual(title, report.title)
        self.assertNotEqual(description, report.description)
        self.assertNotEqual(query, report.query)
        self.assertEqual("The report", report.title)
        self.assertEqual("The description", report.description)
        self.assertEqual("SELECT 1", report.query)