def test_name_constraints(self):
    msg = 'Index names cannot start with an underscore (_).'
    with self.assertRaisesMessage(ValueError, msg):
        models.Index(fields=['title'], name='_name_starting_with_underscore')
    msg = 'Index names cannot start with a number (0-9).'
    with self.assertRaisesMessage(ValueError, msg):
        models.Index(fields=['title'], name='5name_starting_with_number')
def test_name_constraints(self):
    msg = 'Index names cannot start with an underscore (_).'
    with self.assertRaisesMessage(ValueError, msg):
        models.Index(fields=['title'], name='_name_starting_with_underscore')
    msg = 'Index names cannot start with a number (0-9).'
    with self.assertRaisesMessage(ValueError, msg):
        models.Index(fields=['title'], name='5name_starting_with_number')