Repository :
http://git.fedorahosted.org/cgit/fedocal.git
On branch : master
---------------------------------------------------------------
commit f4a4e041b519ab48c2d3b8b7d608f651ee42c6f6
Author: Pierre-Yves Chibon <pingou(a)pingoured.fr>
Date: Tue Nov 6 19:42:00 2012 +0100
get_week_days now returns dates instead of strings
---------------------------------------------------------------
fedocal/fedocallib/__init__.py | 3 +--
fedocal/tests/test_fedocallib.py | 5 +++--
2 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/fedocal/fedocallib/__init__.py b/fedocal/fedocallib/__init__.py
index c4b1c6b..e050e54 100644
--- a/fedocal/fedocallib/__init__.py
+++ b/fedocal/fedocallib/__init__.py
@@ -167,8 +167,7 @@ def get_week_days(year=None, month=None, day=None):
weekdays = []
for i in range(0, 7):
curday = week_start + timedelta(days=i)
- curday_txt = curday.strftime('%A %d')
- weekdays.append(curday_txt)
+ weekdays.append(curday)
return weekdays
diff --git a/fedocal/tests/test_fedocallib.py b/fedocal/tests/test_fedocallib.py
index 6c5e519..558550f 100644
--- a/fedocal/tests/test_fedocallib.py
+++ b/fedocal/tests/test_fedocallib.py
@@ -170,8 +170,9 @@ class Fedocallibtests(Modeltests):
def test_get_week_days(self):
""" Test the get_week_days function. """
- expectdays = ['Monday 01', 'Tuesday 02', 'Wednesday 03',
- 'Thursday 04', 'Friday 05', 'Saturday 06',
'Sunday 07']
+ expectdays = [date(2012, 10, 1), date(2012, 10, 2),
+ date(2012, 10, 3), date(2012, 10, 4), date(2012, 10, 5),
+ date(2012, 10, 6), date(2012, 10, 7)]
days = fedocallib.get_week_days(2012, 10, 3)
self.assertNotEqual(days, None)
self.assertEqual(days, expectdays)