Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Marked a test as an expected failure on MySQL and Python 3.2.

This test hits a bug in current ports of MySQLdb.
  • Loading branch information...
commit 832b4a5722ba6b55e7b17c3bac6614ecca9aa88d 1 parent ea3a378
Aymeric Augustin authored

Showing 1 changed file with 8 additions and 1 deletion. Show diff stats Hide diff stats

  1. 9  tests/model_regress/tests.py
9  tests/model_regress/tests.py
@@ -2,12 +2,14 @@
2 2
 
3 3
 import datetime
4 4
 from operator import attrgetter
  5
+import sys
5 6
 
6 7
 from django.core.exceptions import ValidationError
7 8
 from django.test import TestCase, skipUnlessDBFeature
8 9
 from django.utils import six
9 10
 from django.utils import tzinfo
10  
-from django.db import router
  11
+from django.utils import unittest
  12
+from django.db import connection, router
11 13
 from django.db.models.sql import InsertQuery
12 14
 
13 15
 from .models import (Worker, Article, Party, Event, Department,
@@ -131,6 +133,11 @@ def test_date_lookup(self):
131 133
                 attrgetter("when")
132 134
        )
133 135
 
  136
+    if (3,) <= sys.version_info < (3, 3) and connection.vendor == 'mysql':
  137
+        # In Python < 3.3, datetime.strftime raises an exception for years
  138
+        # below 1000, and existing MySQL DB-API drivers hit this problem.
  139
+        test_date_lookup = unittest.expectedFailure(test_date_lookup)
  140
+
134 141
     def test_date_filter_null(self):
135 142
         # Date filtering was failing with NULL date values in SQLite
136 143
         # (regression test for #3501, amongst other things).

0 notes on commit 832b4a5

Please sign in to comment.
Something went wrong with that request. Please try again.