def test_visitor_id_type_attribute_max_length(self): visitor_component = VisitorForm() TYPES = [ ('KTM', 'KTM'), ('KTP', 'KTP'), ('SIM', 'SIM'), ('Passport', 'Passport'), ] visitor_attribute = visitor_component.fields['id_type'].choices self.assertEqual(visitor_attribute, TYPES)
def test_identity_number_attribute_widget_autocomplete(self): visitor_component = VisitorForm() visitor_attribute = visitor_component.fields[ 'identity_number'].widget.attrs['autocomplete'] self.assertEqual(visitor_attribute, 'off')
def test_identity_number_attribute_widget_placeholder(self): visitor_component = VisitorForm() visitor_attribute = visitor_component.fields[ 'identity_number'].widget.attrs['placeholder'] self.assertEqual(visitor_attribute, 'input your identity number here')
def test_identity_number_attribute_widget_class(self): visitor_component = VisitorForm() visitor_attribute = visitor_component.fields[ 'identity_number'].widget.attrs['class'] self.assertEqual(visitor_attribute, 'form-control')
def test_identity_number_attribute_widget_id(self): visitor_component = VisitorForm() visitor_attribute = visitor_component.fields[ 'identity_number'].widget.attrs['id'] self.assertEqual(visitor_attribute, 'identity-number')
def test_identity_number_attribute_max_length(self): visitor_component = VisitorForm() visitor_attribute = visitor_component.fields[ 'identity_number'].max_length self.assertEqual(visitor_attribute, 75)
def test_identity_number_attribute_required(self): visitor_component = VisitorForm() visitor_attribute = visitor_component.fields[ 'identity_number'].required self.assertTrue(visitor_attribute)
def test_visitor_id_type_attribute_widget_id(self): visitor_component = VisitorForm() visitor_attribute = visitor_component.fields['id_type'].widget.attrs[ 'id'] self.assertEqual(visitor_attribute, 'id-type')
def test_visitor_id_type_attribute_required(self): visitor_component = VisitorForm() visitor_attribute = visitor_component.fields['id_type'].required self.assertTrue(visitor_attribute)
def test_visitor_age_attribute_widget_placeholder(self): visitor_component = VisitorForm() visitor_attribute = visitor_component.fields[ 'visitor_age'].widget.attrs['placeholder'] self.assertEqual(visitor_attribute, 'input your age here')
def test_visitor_age_attribute_max_length(self): visitor_component = VisitorForm() visitor_attribute = visitor_component.fields['visitor_age'].min_value self.assertEqual(visitor_attribute, 17)
def test_visitor_name_attribute_widget_autocomplete(self): visitor_component = VisitorForm() visitor_attribute = visitor_component.fields[ 'visitor_name'].widget.attrs['autocomplete'] self.assertEqual(visitor_attribute, 'off')
def test_visitor_name_attribute_widget_class(self): visitor_component = VisitorForm() visitor_attribute = visitor_component.fields[ 'visitor_name'].widget.attrs['class'] self.assertEqual(visitor_attribute, 'form-control')
def test_visitor_name_attribute_max_length(self): visitor_component = VisitorForm() visitor_attribute = visitor_component.fields['visitor_name'].max_length self.assertEqual(visitor_attribute, 75)