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.
 
 
 
 
 

16 lines
562 B

from hc.test import BaseTestCase
from hc.accounts.models import Project
from hc.api.models import Check
class ProjectModelTestCase(BaseTestCase):
def test_num_checks_available_handles_multiple_projects(self):
# One check in Alice's primary project:
Check.objects.create(user=self.alice, project=self.project)
# One check in Alice's secondary project:
p2 = Project.objects.create(owner=self.alice)
Check.objects.create(user=self.alice, project=p2)
self.assertEqual(self.project.num_checks_available(), 18)