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.

26 lines
754 B

  1. from django.contrib.auth.models import User
  2. from django.test import TestCase
  3. from hc.accounts.models import Profile
  4. class BaseTestCase(TestCase):
  5. def setUp(self):
  6. super(BaseTestCase, self).setUp()
  7. # Normal user for tests
  8. self.alice = User(username="alice", email="[email protected]")
  9. self.alice.set_password("password")
  10. self.alice.save()
  11. self.profile = Profile(user=self.alice, api_key="abc")
  12. self.profile.save()
  13. # "malicious user for tests
  14. self.charlie = User(username="charlie", email="[email protected]")
  15. self.charlie.set_password("password")
  16. self.charlie.save()
  17. charlies_profile = Profile(user=self.charlie)
  18. charlies_profile.save()