freeipa/tests/test_ipapython
John Dennis 159b681c16 Cookie Expires date should be locale insensitive
The Expires attribute in a cookie is supposed to follow the RFC 822
(superseded by RFC 1123) date format. That format includes a weekday
abbreviation (e.g. Tue) which must be in English according to the
RFC's.

ipapython/cookie.py has methods to parse and format the Expires
attribute but they were based on strptime() and strftime() which
respects the locale. If a non-English locale is in effect the wrong
date string will be produced and/or it won't be able to parse the date
string.

The fix is to use the date parsing and formatting functions from
email.utils which specifically follow the RFC's and are not locale
sensitive.

This patch also updates the unit test to use email.utils as well.

The patch should be applied to the following branches:

Ticket: https://fedorahosted.org/freeipa/ticket/3313
2012-12-20 16:39:25 +01:00
..
__init__.py Parse netmasks in IP addresses passed to server install. 2011-05-30 13:36:26 +02:00
test_cookie.py Cookie Expires date should be locale insensitive 2012-12-20 16:39:25 +01:00
test_dn.py Ticket #3008: DN objects hash differently depending on case 2012-08-22 17:23:12 +03:00
test_ipautil.py Parse zone indices in IPv6 addresses in CheckedIPAddress. 2012-03-27 12:03:16 +02:00
test_keyring.py Store session cookie in ccache for cli users 2012-06-14 14:02:26 +02:00
test_ssh.py Use OpenSSH-style public keys as the preferred format of SSH public keys. 2012-09-06 19:11:57 -04:00