test_loadstorage.py 735 B

1234567891011121314151617
  1. from django.test import TestCase
  2. from django.contrib.formtools.wizard.storage import get_storage, MissingStorage
  3. from django.contrib.formtools.wizard.storage.base import BaseStorage
  4. class TestLoadStorage(TestCase):
  5. def test_load_storage(self):
  6. self.assertEqual(
  7. type(get_storage('django.contrib.formtools.wizard.storage.base.BaseStorage', 'wizard1')),
  8. BaseStorage)
  9. def test_missing_storage(self):
  10. self.assertRaises(MissingStorage, get_storage,
  11. 'django.contrib.formtools.wizard.storage.idontexist.IDontExistStorage', 'wizard1')
  12. self.assertRaises(MissingStorage, get_storage,
  13. 'django.contrib.formtools.wizard.storage.base.IDontExistStorage', 'wizard1')