Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Adapted test assertion against yaml dump

Fixes #12914 (again).
  • Loading branch information...
commit 2e55cf580e48b02165b7aafb0d9368c714742137 1 parent 9f9a7f0
@claudep claudep authored
Showing with 4 additions and 1 deletion.
  1. +4 −1 tests/modeltests/timezones/tests.py
View
5 tests/modeltests/timezones/tests.py
@@ -2,6 +2,7 @@
import datetime
import os
+import re
import sys
import time
import warnings
@@ -504,7 +505,9 @@ def assert_xml_contains_datetime(self, xml, dt):
self.assertXMLEqual(field.childNodes[0].wholeText, dt)
def assert_yaml_contains_datetime(self, yaml, dt):
- self.assertIn("- fields: {dt: !!timestamp '%s'}" % dt, yaml)
+ # Depending on the yaml dumper, '!timestamp' might be absent
+ self.assertRegexpMatches(yaml,
+ r"- fields: {dt: !(!timestamp)? '%s'}" % re.escape(dt))
def test_naive_datetime(self):
dt = datetime.datetime(2011, 9, 1, 13, 20, 30)
Please sign in to comment.
Something went wrong with that request. Please try again.