fix tests for update_tutorial_registrant command
@@ -18,10 +18,10 @@ class MockGet(Mock):
@property
def content(self):
- headers = '"tutorialnumber","tutorialname","maxattendees","useremail"\n'
- row1 = '"%s","Tutorial1","8","john@doe.com"\n' % self.tut1
- row2 = '"%s","Tutorial1","8","jane@doe.com"\n' % self.tut1
- row3 = '"%s","Tutorial2","10","john@doe.com"' % self.tut2
+ headers = '"tutorialnumber","tutorialname","maxattendees","useremail","PyConID"\n'
+ row1 = '"%s","Tutorial1","8","john@doe.com",%s\n' % (self.tut1, self.u1)
+ row2 = '"%s","Tutorial1","8","jane@doe.com",%s\n' % (self.tut1, self.u2)
+ row3 = '"%s","Tutorial2","10","john@doe.com",%s' % (self.tut2, self.u1)
return headers + row1 + row2 + row3
def raise_for_status(self):
@@ -62,7 +62,9 @@ class UpdateTutorialRegistrantsTestCase(TestCase):
self.assertEqual(0, tut.registrants.all().count())
mock_get.return_value = MockGet(tut1=tut1.presentation.pk,
- tut2=tut2.presentation.pk)
+ tut2=tut2.presentation.pk,
+ u1=u1.pk,
+ u2=u2.pk)
call_command('update_tutorial_registrants')
tut1 = PyConTutorialProposal.objects.get(pk=tut1.pk)
@@ -93,7 +95,9 @@ class UpdateTutorialRegistrantsTestCase(TestCase):
self.assertIn(u2, tut2.registrants.all())
mock_get.return_value = MockGet(tut1=tut1.presentation.pk,
- tut2=tut2.presentation.pk)
+ tut2=tut2.presentation.pk,
+ u1=u1.pk,
+ u2=u2.pk)
call_command('update_tutorial_registrants')
tut1 = PyConTutorialProposal.objects.get(pk=tut1.pk)
