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.

tests.py 878B

123456789101112131415161718192021222324252627
  1. import unittest
  2. from django.test import TestCase
  3. from oscar.address.tests import *
  4. from oscar.basket.tests import *
  5. from oscar.order.tests import *
  6. from oscar.product.tests import *
  7. from oscar.stock.tests import *
  8. from oscar.checkout.tests import *
  9. from oscar.payment.tests import *
  10. from oscar.shipping.tests import *
  11. from oscar.services import import_module, AppNotFoundError
  12. class ImportAppTests(unittest.TestCase):
  13. def test_a_specified_class_is_imported_correctly(self):
  14. module = import_module('product.models', ['Item'])
  15. self.assertEqual('oscar.product.models', module.__name__)
  16. def test_unknown_apps_raise_exception(self):
  17. self.assertRaises(AppNotFoundError, import_module, 'banana', ['skin'])
  18. def test_no_classes_specified_raise_exception(self):
  19. self.assertRaises(ValueError, import_module, 'product.models')