コード例 #1
0
 def test_update_db(self):
     pos = Position.create_all_held_positions("Test Person")[0]
     original_end_date = pos.end_date
     pos.end_date = "2021-01-18"
     pos.update_in_db()
     pos = Position.create_all_held_positions("Test Person")[0]
     new_end_date = pos.end_date
     self.assertNotEqual(original_end_date, new_end_date)
コード例 #2
0
 def test_position_factory_methods(self):
     self.assertEqual(len(Position.create_all(title="MYSec")), 2)
     self.assertEqual(
         len(
             Position.create_all_fitting_data(
                 [["start_date", ">", "2020-12-12"]], title="MYSec")), 1)
     self.assertEqual(
         len(Position.create_all_held_positions("Test Person")), 1)