def test_update_another_users_reports(self):
     # updating with the wrong user_id does not work
     r = ReportStore.update_reports(
         [self.reports[1].id], 0, recurrent=True
     )
     assert_equals(r, False)
     self.session.commit()
     self.session.expire_all()
示例#2
0
    def test_update_reports_recurrent_false(self):
        r = ReportStore.update_reports(
            [self.reports[0].id, self.reports[2].id], 1, recurrent=False)
        assert_equals(r, True)
        self.session.commit()
        self.session.expire_all()

        assert_equals(self.reports[0].public, False)
        assert_equals(self.reports[1].public, True)
        assert_equals(self.reports[2].public, False)
        assert_equals(self.reports[3].public, True)
        assert_equals(self.reports[0].recurrent, False)
        assert_equals(self.reports[1].recurrent, False)
        assert_equals(self.reports[2].recurrent, False)
        assert_equals(self.reports[3].recurrent, True)
 def test_update_reports_recurrent_false(self):
     r = ReportStore.update_reports(
         [self.reports[0].id, self.reports[2].id], 1, recurrent=False
     )
     assert_equals(r, True)
     self.session.commit()
     self.session.expire_all()
     
     assert_equals(self.reports[0].public, False)
     assert_equals(self.reports[1].public, True)
     assert_equals(self.reports[2].public, False)
     assert_equals(self.reports[3].public, True)
     assert_equals(self.reports[0].recurrent, False)
     assert_equals(self.reports[1].recurrent, False)
     assert_equals(self.reports[2].recurrent, False)
     assert_equals(self.reports[3].recurrent, True)
示例#4
0
 def test_update_another_users_reports(self):
     # updating with the wrong user_id does not work
     r = ReportStore.update_reports([self.reports[1].id], 0, recurrent=True)
     assert_equals(r, False)
     self.session.commit()
     self.session.expire_all()