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.

123456789101112131415161718192021222324252627282930
  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.offer.tests import *
  11. from oscar.shipping.tests import *
  12. from oscar.customer.tests import *
  13. from oscar.discount.tests import *
  14. from oscar.services import import_module, AppNotFoundError
  15. class ImportAppTests(unittest.TestCase):
  16. def test_a_specified_class_is_imported_correctly(self):
  17. module = import_module('product.models', ['Item'])
  18. self.assertEqual('oscar.product.models', module.__name__)
  19. def test_unknown_apps_raise_exception(self):
  20. self.assertRaises(AppNotFoundError, import_module, 'banana', ['skin'])
  21. def test_no_classes_specified_raise_exception(self):
  22. self.assertRaises(ValueError, import_module, 'product.models')