Skip to content

Commit

Permalink
Added regression test for django#13844
Browse files Browse the repository at this point in the history
This test acts as close to the problem as possible - by running
convert_values directly. Note that this test does not trigger under
sqlite, as the sqlite layer overrides convert_value behavior.
  • Loading branch information
valhallasw committed May 16, 2012
1 parent 085c03e commit 50edfe6
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions tests/regressiontests/aggregation_regress/tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -865,3 +865,16 @@ def test_filtering_by_annotation_name(self):
['Peter Norvig'],
lambda b: b.name
)

def test_type_conversion_for_CharField_aggregations(self):
# regression test for #13844
# the database backend convert_values function should not case
# CharFields to float.
from django.db.models import CharField
from django.db import connection
testData = u'not_a_float_value'
testField = CharField()
self.assertEqual(
connection.ops.convert_values(testData, testField),
testData
)

0 comments on commit 50edfe6

Please sign in to comment.