﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
26131	model field choices are not enforced	stiffupperlip	nobody	"In Django 1.8.8 when I create a model class like below, `choices` are not enforced when creating an instance of the model class:

{{{
class HTTPMethod(models.Model):
    HTTP_METHODS = [(_, _) for _ in ['get', 'post', 'put', 'patch', 'delete', 'head', 'options', 'trace', 'connect']]

    id = models.AutoField(primary_key=True)
    name = models.CharField(choices=HTTP_METHODS, unique=True, max_length=255)


h = HTTPMethod(name='something invalid')
h.save()
}}}

No errors are raised and invalid data is stored in the model.

Python 2.7.6 on Ubuntu 14.04"	Bug	closed	Database layer (models, ORM)	1.8	Normal	invalid			Unreviewed	0	0	0	0	0	0
