From 009543b7e476d3bcaca3dd8576a47631c06de1e7 Mon Sep 17 00:00:00 2001 From: Deniz Turgut Date: Thu, 26 Jun 2014 00:51:45 -0400 Subject: [PATCH] Fix test errors on OSX On OSX, if LC_TIME and LC_CTYPE differs the output of strftime is not properly decoded in Python 3. This makes sure that the 'utils.DateFormatter' and the related Jinja filter 'strftime' set the same value for LC_TIME and LC_CTYPE while formatting. Also, '%a' is removed from DEFAULT_DATE_FORMAT in 'custom_locale' tests. OSX and *nix have different conversions for '%a' ('Jeu' vs 'jeu.') and there is not a feasible way to handle the difference for tests. --- docs/contribute.rst | 2 +- .../tests/output/custom_locale/archives.html | 20 +++++++++---------- .../author/alexis-metaireau.html | 8 ++++---- .../author/alexis-metaireau2.html | 10 +++++----- .../author/alexis-metaireau3.html | 4 ++-- .../output/custom_locale/category/bar.html | 2 +- .../output/custom_locale/category/cat1.html | 8 ++++---- .../output/custom_locale/category/misc.html | 8 ++++---- .../output/custom_locale/category/yeah.html | 4 ++-- .../custom_locale/drafts/a-draft-article.html | 2 +- pelican/tests/output/custom_locale/index.html | 8 ++++---- .../tests/output/custom_locale/index2.html | 10 +++++----- .../tests/output/custom_locale/index3.html | 4 ++-- .../output/custom_locale/oh-yeah-fr.html | 2 +- .../02/this-is-a-super-article/index.html | 4 ++-- .../2010/octobre/15/unbelievable/index.html | 2 +- .../posts/2010/octobre/20/oh-yeah/index.html | 2 +- .../20/a-markdown-powered-article/index.html | 2 +- .../2011/février/17/article-1/index.html | 2 +- .../2011/février/17/article-2/index.html | 2 +- .../2011/février/17/article-3/index.html | 2 +- .../2012/février/29/second-article/index.html | 2 +- .../30/filename_metadata-example/index.html | 2 +- .../custom_locale/second-article-fr.html | 2 +- .../tests/output/custom_locale/tag/bar.html | 8 ++++---- .../tests/output/custom_locale/tag/baz.html | 2 +- .../tests/output/custom_locale/tag/foo.html | 6 +++--- .../output/custom_locale/tag/foobar.html | 4 ++-- .../tests/output/custom_locale/tag/yeah.html | 2 +- pelican/tests/test_pelican.py | 2 +- pelican/utils.py | 10 ++++++++-- ...{pelican_FR.conf.py => pelican.conf_FR.py} | 1 + 32 files changed, 78 insertions(+), 71 deletions(-) rename samples/{pelican_FR.conf.py => pelican.conf_FR.py} (98%) diff --git a/docs/contribute.rst b/docs/contribute.rst index 044ef924..19604da0 100644 --- a/docs/contribute.rst +++ b/docs/contribute.rst @@ -91,7 +91,7 @@ functional tests. To do so, you can use the following two commands:: $ LC_ALL=en_US.utf8 pelican -o pelican/tests/output/custom/ \ -s samples/pelican.conf.py samples/content/ $ LC_ALL=fr_FR.utf8 pelican -o pelican/tests/output/custom_locale/ \ - -s samples/pelican_FR.conf.py samples/content/ + -s samples/pelican.conf_FR.py samples/content/ $ LC_ALL=en_US.utf8 pelican -o pelican/tests/output/basic/ \ samples/content/ diff --git a/pelican/tests/output/custom_locale/archives.html b/pelican/tests/output/custom_locale/archives.html index a7b96336..1336b487 100644 --- a/pelican/tests/output/custom_locale/archives.html +++ b/pelican/tests/output/custom_locale/archives.html @@ -32,25 +32,25 @@

Archives for Alexis' log

-
ven. 30 novembre 2012
+
30 novembre 2012
FILENAME_METADATA example
-
mer. 29 février 2012
+
29 février 2012
Second article
-
mer. 20 avril 2011
+
20 avril 2011
A markdown powered article
-
jeu. 17 février 2011
+
17 février 2011
Article 1
-
jeu. 17 février 2011
+
17 février 2011
Article 2
-
jeu. 17 février 2011
+
17 février 2011
Article 3
-
jeu. 02 décembre 2010
+
02 décembre 2010
This is a super article !
-
mer. 20 octobre 2010
+
20 octobre 2010
Oh yeah !
-
ven. 15 octobre 2010
+
15 octobre 2010
Unbelievable !
-
dim. 14 mars 2010
+
14 mars 2010
The baz tag
diff --git a/pelican/tests/output/custom_locale/author/alexis-metaireau.html b/pelican/tests/output/custom_locale/author/alexis-metaireau.html index b54446c8..7c2fa448 100644 --- a/pelican/tests/output/custom_locale/author/alexis-metaireau.html +++ b/pelican/tests/output/custom_locale/author/alexis-metaireau.html @@ -34,7 +34,7 @@

FILENAME_METADATA example