From c711af6a42326f07fdb14730c0211f4629b0b772 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rapha=C3=ABl=20Barrois?= Date: Thu, 1 Sep 2016 14:29:34 +0200 Subject: Fix deconstruct() tests under Pypy. Pypy seems to deconstruct fields differently from Django, thus bringing in variations in the actual deconstruct() output. --- tests/test_django.py | 26 ++++++++++++++++++-------- 1 file changed, 18 insertions(+), 8 deletions(-) diff --git a/tests/test_django.py b/tests/test_django.py index 93ea810..1c3c46a 100644 --- a/tests/test_django.py +++ b/tests/test_django.py @@ -5,6 +5,8 @@ from __future__ import unicode_literals import unittest +import sys + import semantic_version from .setup_django import django_loaded @@ -213,17 +215,25 @@ class FieldMigrationTests(DjangoTestCase): partial=True, coerce=True, ) - self.assertEqual( - field.deconstruct()[3], - {'coerce': True, 'partial': True, 'max_length': 200}, - ) + expected = { + 'coerce': True, + 'partial': True, + 'max_length': 200, + } + if hasattr(sys, 'pypy_version_info'): + # Django under Pypy adds this extra key. + expected['help_text'] = u'' + + self.assertEqual(field.deconstruct()[3], expected) def test_spec_field(self): field = django_fields.SpecField() - self.assertEqual( - field.deconstruct()[3], - {'max_length': 200}, - ) + expected = {'max_length': 200} + if hasattr(sys, 'pypy_version_info'): + # Django under Pypy adds this extra key. + expected['help_text'] = u'' + + self.assertEqual(field.deconstruct()[3], expected) @unittest.skipIf(not django_loaded, "Django not installed") -- cgit v1.2.1