odoo_dev 开发培训作业:图书管理系统
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

23 lines
812B

  1. from odoo.tests.common import TransactionCase
  2. class TestBook(TransactionCase):
  3. def setUp(self, *args, **kwargs):
  4. result = super().setUp(*args, **kwargs)
  5. user_admin = self.env.ref('base.user_admin')
  6. self.env = self.env(user=user_admin)
  7. self.Book = self.env['library.book']
  8. self.book_ode = self.Book.create({
  9. # 'name': 'Odoo Development Essentials',
  10. 'isbn': '879-1-78439-279-6'})
  11. return result
  12. def test_create(self):
  13. "Test Books are active by default"
  14. self.assertEqual(self.book_ode.active, False)
  15. def test_check_isbn(self):
  16. "Check valid ISBN"
  17. self.assertTrue(self.book_ode._check_isbn)
  18. def test_check_isbn(self):
  19. "Check valid ISBN"
  20. self.assertTrue(self.book_ode._check_isbn)
上海开阖软件有限公司 沪ICP备12045867号-1