﻿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
21471	CharField max_lenght is not enforced on SQLite backend with Python 3	lvella	nobody	"I am using Django 1.6 with CPython 3.3.2. The minimal test case to show the bug is as follows:

From a Django project using SQLite, create an app:

$ python3 manage.py startapp case

Add the following contents to 'case/models.py':

from django.db import models

class A(models.Model):
    b = models.CharField(max_length=10)

    def __str__(self):
        return self.b

Then, after adding the app to INSTALLED_APPS setting, sync the database:

$ python3 manage.py syncdb

Then run:
$ python3 manage.py shell
>>> from case.models import A
>>> a = A(b='x'*20)
>>> a.save()
>>> A.objects.all()[0]
<A: xxxxxxxxxxxxxxxxxxxx>

If you could reproduce, the 20 characters string was allowed on a CharField with max_length=10. This caused me problems because I user SQLite on development, and PostgreSQL on production, and because of this issue, I missed a bug during development only to see it in production."	Bug	closed	Database layer (models, ORM)	1.6	Normal	invalid			Unreviewed	0	0	0	0	0	0
