def test_modifying(self): _ = get_basics(self.db) new_basics = Basics(**self.new_basics) db_basics = update_basics(self.db, new_basics) self.assertEqual(db_basics.name, new_basics.name) self.assertEqual(db_basics.email, new_basics.email) self.assertEqual(db_basics.summary, new_basics.summary)
def test_basics_email_wrong_type(self): basics = get_basics(self.db) class FakeEmail: pass basics.email = FakeEmail() with self.assertRaises(InterfaceError) as error: update_basics(self.db, basics) self.assertIn("unsupported type", str(error.exception))
def test_missing_basics_summary(self): basics = get_basics(self.db) delattr(basics, "summary") update_basics(self.db, basics) resume = create_resume(self.db) self.assertIsNone(json.loads(resume.json())["basics"]["summary"])
def test_get(self): basics = get_basics(self.db) self.assertIsInstance(basics, BasicsModel) self.assertEqual(basics.name, test_resume["basics"]["name"])
def create_resume(db: Session) -> Resume: db_basics = get_basics(db) db_work = get_all_work(db) return Resume(basics=db_basics, work=db_work)