test_testutils.py 568 B

1234567891011121314151617
  1. from django.test import TestCase
  2. from misago.acl.models import Role, ForumRole
  3. from misago.acl.testutils import fake_post_data
  4. class FakeTestDataTests(TestCase):
  5. def test_fake_post_data_for_role(self):
  6. """fake data was created for Role"""
  7. test_data = fake_post_data(Role(), {'can_fly': 1})
  8. self.assertIn('can_fly', test_data)
  9. def test_fake_post_data_for_forumrole(self):
  10. """fake data was created for ForumRole"""
  11. test_data = fake_post_data(ForumRole(), {'can_swim': 1})
  12. self.assertIn('can_swim', test_data)