Skip to content
Snippets Groups Projects
Commit a3d31e3d authored by Erin Mullaney's avatar Erin Mullaney Committed by Todd Dembrey
Browse files

#810 adding a test for the new by_lead filter method

parent 5d359d05
No related branches found
No related tags found
No related merge requests found
...@@ -67,6 +67,17 @@ class BaseRoundsAndLabTestCase: ...@@ -67,6 +67,17 @@ class BaseRoundsAndLabTestCase:
self.assertEqual(fetched_obj, obj) self.assertEqual(fetched_obj, obj)
self.assertFalse(base_qs.active().exists()) self.assertFalse(base_qs.active().exists())
def test_by_lead(self):
obj = self.base_factory()
# Create an additional round which will create a new staff lead
round_other_lead = RoundFactory()
qs_all = RoundsAndLabs.objects.with_progress()
qs_by_lead = qs_all.by_lead(obj.lead)
fetched_obj = qs_by_lead.first()
self.assertEqual(qs_all.count(), 2)
self.assertEqual(qs_by_lead.count(), 1)
self.assertEqual(fetched_obj.lead, obj.lead.full_name)
class TestForLab(BaseRoundsAndLabTestCase, TestCase): class TestForLab(BaseRoundsAndLabTestCase, TestCase):
base_factory = LabFactory base_factory = LabFactory
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment