Exemple #1
0
 def _determine_seat_type(self, product):
     """
     Return the seat type based on the product class
     """
     seat_type = None
     if product.get_product_class().name == SEAT_PRODUCT_CLASS_NAME:
         seat_type = get_certificate_type_display_value(product.attr.certificate_type)
     elif product.get_product_class().name == ENROLLMENT_CODE_PRODUCT_CLASS_NAME:
         seat_type = get_certificate_type_display_value(product.attr.seat_type)
     return seat_type
Exemple #2
0
 def _determine_seat_type(self, product):
     """
     Return the seat type based on the product class
     """
     seat_type = None
     if product.is_seat_product:
         seat_type = get_certificate_type_display_value(product.attr.certificate_type)
     elif product.is_enrollment_code_product:
         seat_type = get_certificate_type_display_value(product.attr.seat_type)
     return seat_type
Exemple #3
0
 def _determine_seat_type(self, product):
     """
     Return the seat type based on the product class
     """
     seat_type = None
     if product.get_product_class().name == SEAT_PRODUCT_CLASS_NAME:
         seat_type = get_certificate_type_display_value(product.attr.certificate_type)
     elif product.get_product_class().name == ENROLLMENT_CODE_PRODUCT_CLASS_NAME:
         seat_type = get_certificate_type_display_value(product.attr.seat_type)
     return seat_type
Exemple #4
0
 def test_cert_display_assertion(self):
     """ Verify assertion for invalid cert type """
     self.assertRaises(ValueError,
                       lambda: get_certificate_type_display_value('junk'))
Exemple #5
0
 def test_cert_display(self, cert_type, cert_display):
     """ Verify certificate display types. """
     self.assertEqual(get_certificate_type_display_value(cert_type),
                      cert_display)
Exemple #6
0
 def _get_certificate_type_display_value(self, product):
     certificate_type = self._get_certificate_type(product)
     if certificate_type:
         return get_certificate_type_display_value(certificate_type)
     return None
Exemple #7
0
 def test_cert_display_assertion(self):
     """ Verify assertion for invalid cert type """
     self.assertRaises(ValueError, lambda: get_certificate_type_display_value('junk'))
Exemple #8
0
 def test_cert_display(self, cert_type, cert_display):
     """ Verify certificate display types. """
     self.assertEqual(get_certificate_type_display_value(cert_type), cert_display)