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.

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