maraujop/django-crispy-forms — pull request #381 by dashdrum (2014-11-11 02:18:31+00:00)
Title: Use StrictVersion for version tests

test_layout.py includes django version comparisons in test_formset_layout() and test_modelformset_layout().

django_version = django.get_version()
if django_version < '1.5':

With django versions 1.4.10 through 1.4.16 (most current), the simple comparison of strings incorrectly determines these version are 'less than' 1.4.4, and the tests fail.

I have modified these comparisons to use the StrictVersion class found in distutils. The comparisons, and the tests, are now successful.

django_version = StrictVersion(django.get_version())
if django_version < StrictVersion('1.5'):