def register_to_check_discount(self,series):
s = series<EOL>response = self.client.get(reverse('<STR_LIT>'))<EOL>self.assertEqual(response.status_code,<NUM_LIT:200>)<EOL>self.assertIn(s, response.context['<STR_LIT>'])<EOL>post_data = {'<STR_LIT>' % s.id: response.context_data['<STR_LIT>'].fields['<STR_LIT>' % s.id].choices[<NUM_LIT:0>][<NUM_LIT:0>]}<EOL>response = self.client.post(reverse('<STR_LIT>'),post_data,follow=True)<EOL>self.assertEqual(response.redirect_chain,[(reverse('<STR_LIT>'), <NUM_LIT>)])<EOL>tr = TemporaryRegistration.objects.get(id=self.client.session[REG_VALIDATION_STR].get('<STR_LIT>'))<EOL>self.assertTrue(tr.temporaryeventregistration_set.filter(event__id=s.id).exists())<EOL>self.assertEqual(tr.temporaryeventregistration_set.get(event__id=s.id).price, s.getBasePrice())<EOL>self.assertEqual(response.context_data.get('<STR_LIT>'), s.getBasePrice())<EOL>post_data = {<EOL>'<STR_LIT>': '<STR_LIT>',<EOL>'<STR_LIT>': '<STR_LIT>',<EOL>'<STR_LIT:email>': '<STR_LIT>',<EOL>'<STR_LIT>': True,<EOL>}<EOL>return self.client.post(reverse('<STR_LIT>'),post_data,follow=True)<EOL>
This method makes it easy to determine whether discounts are working
correctly for a single class registration