[fedocal] master: Update the UI to reflect changes wrt the management of the recursion (bdfec5e)
by Pierre-YvesChibon
Repository : http://git.fedorahosted.org/cgit/fedocal.git
On branch : master
>---------------------------------------------------------------
commit bdfec5eb0b1e72bca48e7d617dfed7897e8ef0ed
Author: Pierre-Yves Chibon <pingou(a)pingoured.fr>
Date: Sun Nov 4 15:38:19 2012 +0100
Update the UI to reflect changes wrt the management of the recursion
>---------------------------------------------------------------
fedocal/__init__.py | 105 +++++++++++++++-----------------------------
fedocal/fedocallib/week.py | 10 ++++
fedocal/forms.py | 9 +---
3 files changed, 49 insertions(+), 75 deletions(-)
diff --git a/fedocal/__init__.py b/fedocal/__init__.py
index 996fe9e..2118696 100644
--- a/fedocal/__init__.py
+++ b/fedocal/__init__.py
@@ -40,8 +40,7 @@ from flask_fas import FAS, cla_plus_one_required
import forms as forms
import fedocallib as fedocallib
-from fedocallib.model import (Calendar, Meeting, Reminder,
- Recursive)
+from fedocallib.model import (Calendar, Meeting, Reminder)
CONFIG = ConfigParser.ConfigParser()
if os.path.exists('/etc/fedocal.cfg'): # pragma: no cover
@@ -250,6 +249,12 @@ def add_meeting(calendar_name):
session = fedocallib.create_session(CONFIG.get('fedocal', 'db_url'))
calendarobj = Calendar.by_id(session, calendar_name)
if form.validate_on_submit():
+ print fedocallib.agenda_is_free(session,
+ calendarobj,
+ form.meeting_date.data,
+ int(form.meeting_time_start.data),
+ int(form.meeting_time_stop.data)
+ )
if not fedocallib.is_user_managing_in_calendar(session,
calendarobj.calendar_name, flask.g.fas_user):
flask.flash('You are not allowed to add a meeting to'\
@@ -267,17 +272,24 @@ def add_meeting(calendar_name):
flask.render_template('add_meeting.html',
calendar=calendarobj, form=form)
elif bool(calendarobj.calendar_multiple_meetings) or \
- (bool(calendarobj.calendar_multiple_meetings) == False and \
+ (not bool(calendarobj.calendar_multiple_meetings) and \
fedocallib.agenda_is_free(session,
calendarobj,
form.meeting_date.data,
int(form.meeting_time_start.data),
int(form.meeting_time_stop.data)
)):
+
+ manager = '%s,' % flask.g.fas_user.username
+ end_date = form.end_repeats.data
+ if not end_date and form.frequency.data:
+ end_date = datetime.date(2025, 12, 31)
+ frequency = form.frequency.data
+ if not frequency:
+ frequency = None
region = form.meeting_region.data
- if not calendarobj.calendar_regional_meetings:
+ if not calendarobj.calendar_regional_meetings or not region:
region = None
- manager = '%s,' % flask.g.fas_user.username
meeting = Meeting(
meeting_name=form.meeting_name.data,
meeting_manager=manager,
@@ -289,8 +301,9 @@ def add_meeting(calendar_name):
meeting_information=form.information.data,
calendar_name=calendarobj.calendar_name,
reminder_id=None,
- recursion_id=None,
- meeting_region=region)
+ meeting_region=region,
+ recursion_frequency=frequency,
+ recursion_ends=end_date)
meeting.save(session)
try:
session.flush()
@@ -315,28 +328,6 @@ def add_meeting(calendar_name):
return flask.render_template('add_meeting.html',
calendar=calendarobj, form=form)
- if form.frequency.data:
- ends_date = form.end_repeats.data
- if not ends_date:
- ends_date = datetime.date(2121, 12, 31)
- recursion = Recursive(
- recursion_frequency=form.frequency.data,
- recursion_ends=ends_date
- )
- recursion.save(session)
- try:
- session.flush()
- meeting.recursion = recursion
- session.flush()
- except Exception, err:
- print 'add_meeting:', err
- flask.flash(
- 'Could not add this reminder to this meeting')
- flask.render_template('add_meeting.html',
- calendar=calendarobj, form=form)
-
- fedocallib.save_recursive_meeting(session, meeting)
-
try:
session.commit()
except Exception, err:
@@ -392,7 +383,21 @@ def edit_meeting(meeting_id):
meeting_time_stop=datetime.time(int(
form.meeting_time_stop.data))
meeting.meeting_information = form.information.data
- meeting.meeting_region=form.meeting_region.data
+
+ region = form.meeting_region.data
+ if not region:
+ region = None
+ meeting.meeting_region=region
+
+ frequency = form.frequency.data
+ if not frequency:
+ frequency = None
+ meeting.recursion_frequency = frequency
+
+ ends_date = form.end_repeats.data
+ if not ends_date:
+ ends_date = datetime.date(2025, 12, 31)
+ meeting.recursion_ends = ends_date
if form.remind_when.data and form.remind_who.data:
if meeting.reminder_id:
@@ -420,46 +425,8 @@ def edit_meeting(meeting_id):
meeting.reminder.delete(session)
except Exception, err:
print 'edit_meeting:', err
- meeting.save(session)
-
- if form.frequency.data and form.recursive_edit.data:
- ends_date = form.end_repeats.data
- if not ends_date:
- ends_date = datetime.date(2025, 12, 31)
- if meeting.recursion_id:
- meeting.recursion.recursion_frequency = form.frequency.data
- meeting.recursion.recursion_ends = ends_date
- meeting.recursion.save(session)
- fedocallib.delete_recursive_meeting_after_end(
- session, meeting)
- fedocallib.update_recursive_meeting(
- session, meeting)
- fedocallib.add_recursive_meeting_after_end(
- session, meeting)
- else:
- recursion = Recursive(
- recursion_frequency=form.frequency.data,
- recursion_ends=ends_date
- )
- recursion.save(session)
- try:
- session.flush()
- meeting.recursion = recursion
- session.flush()
- except Exception, err:
- print 'add_meeting:', err
- flask.flash('Could not edit this recursivity '\
- 'of this meeting')
- return flask.render_template('edit_meeting.html',
- meeting=meeting, calendar=calendarobj,
- form=form)
- fedocallib.save_recursive_meeting(session, meeting)
- elif meeting.recursion_id:
- try:
- meeting.recursion.delete(session)
- except Exception, err:
- print 'edit_meeting:', err
+ meeting.save(session)
session.commit()
except Exception, err:
print 'edit_meeting:', err
diff --git a/fedocal/fedocallib/week.py b/fedocal/fedocallib/week.py
index 8a14e83..6e8fa21 100644
--- a/fedocal/fedocallib/week.py
+++ b/fedocal/fedocallib/week.py
@@ -14,6 +14,7 @@ See http://www.gnu.org/copyleft/gpl.html for the full text of the
license.
"""
+from datetime import date
from datetime import timedelta
from model import Meeting
@@ -41,6 +42,15 @@ class Week(object):
self.meetings = Meeting.get_by_date(self.session, self.calendar,
self.start_date, self.stop_date)
+ for meeting in Meeting.get_active_regular_meeting(self.session,
+ self.start_date):
+ for delta in range(0, 7):
+ day = self.start_date + timedelta(days=delta)
+ if ((meeting.meeting_date - day).days %
+ meeting.recursion_frequency) == 0:
+ if meeting not in self.meetings:
+ self.meetings.append(meeting)
+
def __repr__(self):
""" Representation of the Week object when printed.
"""
diff --git a/fedocal/forms.py b/fedocal/forms.py
index 110a440..81a3da8 100644
--- a/fedocal/forms.py
+++ b/fedocal/forms.py
@@ -85,9 +85,6 @@ class AddMeetingForm(wtf.Form):
remind_who = wtf.TextField('Send reminder to',
[wtf.validators.Email(), wtf.validators.optional()])
- # Recursive edit
- recursive_edit = wtf.BooleanField('Yes I want to edit all the meetings')
-
def __init__(self, *args, **kwargs):
""" Calls the default constructor with the normal argument but
if a meeting is set using the meeting keyword, then fill the
@@ -115,9 +112,9 @@ class AddMeetingForm(wtf.Form):
'%s,' % flask.g.fas_user.username, '')
self.comanager.data = meeting_manager
self.meeting_region.data = meeting.meeting_region
- if meeting.recursion_id:
- self.frequency.data = meeting.recursion.recursion_frequency
- self.end_repeats.data = meeting.recursion.recursion_ends
+ print meeting.recursion_frequency
+ self.frequency.data = meeting.recursion_frequency
+ self.end_repeats.data = meeting.recursion_ends
if meeting.reminder_id:
self.remind_when.data = meeting.reminder.reminder_offset
self.remind_who.data = meeting.reminder.reminder_to
10 years, 4 months
[fedocal] master: Fix agenda template as we now have trailing slash (2e46652)
by Pierre-YvesChibon
Repository : http://git.fedorahosted.org/cgit/fedocal.git
On branch : master
>---------------------------------------------------------------
commit 2e46652086807500c88bcbf020c437559dd22732
Author: Pierre-Yves Chibon <pingou(a)pingoured.fr>
Date: Sun Nov 4 15:35:48 2012 +0100
Fix agenda template as we now have trailing slash
>---------------------------------------------------------------
fedocal/templates/agenda.html | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/fedocal/templates/agenda.html b/fedocal/templates/agenda.html
index e3431c0..3c8ca7c 100644
--- a/fedocal/templates/agenda.html
+++ b/fedocal/templates/agenda.html
@@ -82,9 +82,9 @@
$('.event').click(function(){
var _id = $(this).attr('id');
var _meetId = _id.replace('meeting_', '');
- var _url = "{{ url_for('view_meeting', meeting_id=0) }}".replace('/0','/');
+ var _url = "{{ url_for('view_meeting', meeting_id=0) }}".replace('/0/','/');
$.ajax({
- url: _url + _meetId + '/0',
+ url: _url + _meetId + '/0/',
type: 'GET',
dataType: 'html',
success: function(res) {
10 years, 4 months
[fedocal] master: We need a date not a datetime for these functions (15ed0fc)
by Pierre-YvesChibon
Repository : http://git.fedorahosted.org/cgit/fedocal.git
On branch : master
>---------------------------------------------------------------
commit 15ed0fc2cac24283f5ea1b2b88e4f9a844f83665
Author: Pierre-Yves Chibon <pingou(a)pingoured.fr>
Date: Sun Nov 4 15:30:40 2012 +0100
We need a date not a datetime for these functions
>---------------------------------------------------------------
fedocal/fedocallib/__init__.py | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/fedocal/fedocallib/__init__.py b/fedocal/fedocallib/__init__.py
index 0b49c3a..7292165 100644
--- a/fedocal/fedocallib/__init__.py
+++ b/fedocal/fedocallib/__init__.py
@@ -289,7 +289,7 @@ def get_future_single_meeting_of_user(session, username):
past meetings for.
"""
meetings = Meeting.get_future_single_meeting_of_user(session,
- username, datetime.utcnow())
+ username, date.today())
return meetings
@@ -302,7 +302,7 @@ def get_future_regular_meeting_of_user(session, username):
past meetings for.
"""
meetings = Meeting.get_future_regular_meeting_of_user(session,
- username, datetime.utcnow())
+ username, date.today())
return meetings
10 years, 4 months
[fedocal] master: Start refactoring the recursion in the meeting (e3f7a8a)
by Pierre-YvesChibon
Repository : http://git.fedorahosted.org/cgit/fedocal.git
On branch : master
>---------------------------------------------------------------
commit e3f7a8a0e745ea6f810a079c772fa0e36b519df5
Author: Pierre-Yves Chibon <pingou(a)pingoured.fr>
Date: Sun Nov 4 12:15:20 2012 +0100
Start refactoring the recursion in the meeting
>---------------------------------------------------------------
Diff suppressed because of size. To see it, use:
git diff --patch-with-stat --no-color --find-copies-harder --ignore-space-at-eol ^e3f7a8a0e745ea6f810a079c772fa0e36b519df5~1 e3f7a8a0e745ea6f810a079c772fa0e36b519df5
10 years, 4 months
[fedocal] master: Add default value, update documentation and add the get_active_regular_meeting method used in the Week class (8c43a68)
by Pierre-YvesChibon
Repository : http://git.fedorahosted.org/cgit/fedocal.git
On branch : master
>---------------------------------------------------------------
commit 8c43a6869d13c7fd542bed58d90ec1ab53a5a31b
Author: Pierre-Yves Chibon <pingou(a)pingoured.fr>
Date: Sun Nov 4 15:31:58 2012 +0100
Add default value, update documentation and add the get_active_regular_meeting method used in the Week class
>---------------------------------------------------------------
fedocal/fedocallib/model.py | 23 +++++++++++++++++------
1 files changed, 17 insertions(+), 6 deletions(-)
diff --git a/fedocal/fedocallib/model.py b/fedocal/fedocallib/model.py
index 2794f7d..60038c4 100644
--- a/fedocal/fedocallib/model.py
+++ b/fedocal/fedocallib/model.py
@@ -265,6 +265,17 @@ class Meeting(BASE):
(Meeting.meeting_date < stop_date)).all()
@classmethod
+ def get_active_regular_meeting(cls, session, end_date):
+ """ Retrieve the list of meetings with a recursion which
+ end_date is not past the provided end_date.
+ """
+ meetings = session.query(cls).filter(and_
+ (Meeting.recursion_ends >= end_date),
+ (Meeting.recursion_frequency != None)
+ ).order_by(Meeting.meeting_date).all()
+ return meetings
+
+ @classmethod
def get_by_date_and_region(cls, session, calendar, start_date,
stop_date, region):
""" Retrieve the list of meetings in a region between two date.
@@ -300,10 +311,10 @@ class Meeting(BASE):
@classmethod
def get_future_single_meeting_of_user(cls, session, username,
- start_date):
+ start_date=date.today()):
""" Retrieve the list of meetings which specified username
is among the managers and which date is newer or egual than the
- specified one.
+ specified one (which defaults to today).
"""
return session.query(cls).filter(and_
(Meeting.meeting_date >= start_date),
@@ -312,13 +323,13 @@ class Meeting(BASE):
@classmethod
def get_future_regular_meeting_of_user(cls, session, username,
- start_date):
+ end_date=date.today()):
""" Retrieve the list of meetings which specified username
- is among the managers and which date is newer or egual than the
- specified one.
+ is among the managers and which end date is older or egual to
+ specified one (which by default is today).
"""
meetings = session.query(cls).filter(and_
- (Meeting.meeting_date >= start_date),
+ (Meeting.recursion_ends >= end_date),
(Meeting.recursion_frequency != None),
(Meeting.meeting_manager.like('%%%s%%' % username))
).order_by(Meeting.meeting_date).all()
10 years, 4 months
[fedocal] master: Override HTMLCalendar to produce valid HTML output (dadaed2)
by Johan Cwiklinski
Repository : http://git.fedorahosted.org/cgit/fedocal.git
On branch : master
>---------------------------------------------------------------
commit dadaed250b3e0351cceeb604a5481039d97df9fe
Author: Johan Cwiklinski <johan(a)x-tnd.be>
Date: Sun Nov 4 15:28:53 2012 +0100
Override HTMLCalendar to produce valid HTML output
>---------------------------------------------------------------
fedocal/fedocallib/__init__.py | 5 ++-
fedocal/fedocallib/fedora_calendar.py | 39 +++++++++++++++++++++++++++++++++
fedocal/tests/test_fedocallib.py | 2 +-
3 files changed, 43 insertions(+), 3 deletions(-)
diff --git a/fedocal/fedocallib/__init__.py b/fedocal/fedocallib/__init__.py
index c8d6ff0..6b05a4a 100644
--- a/fedocal/fedocallib/__init__.py
+++ b/fedocal/fedocallib/__init__.py
@@ -27,7 +27,7 @@ from sqlalchemy.orm import sessionmaker
from week import Week
from model import Calendar, Reminder, Meeting
-import calendar as pycalendar
+from fedora_calendar import FedocalCalendar
MONTH = ['January', 'February', 'March', 'April', 'May', 'June', 'July',
'August', 'September', 'October', 'November', 'December']
@@ -528,6 +528,7 @@ def get_html_monthly_cal(month = None, year = None):
if month is None:
month = curdate.month
- htmlcal = pycalendar.HTMLCalendar()
+ htmlcal = FedocalCalendar()
curmonth_cal_nf = htmlcal.formatmonth(year, month)
+
return curmonth_cal_nf
diff --git a/fedocal/fedocallib/fedora_calendar.py b/fedocal/fedocallib/fedora_calendar.py
new file mode 100644
index 0000000..ece9865
--- /dev/null
+++ b/fedocal/fedocallib/fedora_calendar.py
@@ -0,0 +1,39 @@
+# -*- coding: utf-8 -*-
+
+"""
+fedora_calendar - HTML Calendar
+
+Copyright (C) 2012 Johan Cwiklinski
+Author: Johan Cwiklinski <johan(a)x-tnd.be>
+
+This program is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 3 of the License, or (at
+your option) any later version.
+See http://www.gnu.org/copyleft/gpl.html for the full text of the
+license.
+"""
+
+from calendar import HTMLCalendar
+from datetime import date
+
+class FedocalCalendar(HTMLCalendar):
+
+ def formatmonth(self, theyear, themonth, withyear=True):
+ """
+ Return a formatted month as a html valid table.
+ """
+ v = []
+ a = v.append
+ a('<table class="month">')
+ a('\n')
+ a(self.formatmonthname(theyear, themonth, withyear=withyear))
+ a('\n')
+ a(self.formatweekheader())
+ a('\n')
+ for week in self.monthdays2calendar(theyear, themonth):
+ a(self.formatweek(week))
+ a('\n')
+ a('</table>')
+ a('\n')
+ return ''.join(v)
diff --git a/fedocal/tests/test_fedocallib.py b/fedocal/tests/test_fedocallib.py
index a55c7c3..f3d0475 100644
--- a/fedocal/tests/test_fedocallib.py
+++ b/fedocal/tests/test_fedocallib.py
@@ -49,7 +49,7 @@ from fedocallib import model
from tests import Modeltests
result_201211_html = """
-<table border="0" cellpadding="0" cellspacing="0" class="month">
+<table class="month">
<tr><th colspan="7" class="month">November 2012</th></tr>
<tr><th class="mon">Mon</th><th class="tue">Tue</th><th class="wed">Wed</th><th class="thu">Thu</th><th class="fri">Fri</th><th class="sat">Sat</th><th class="sun">Sun</th></tr>
<tr><td class="noday"> </td><td class="noday"> </td><td class="noday"> </td><td class="thu">1</td><td class="fri">2</td><td class="sat">3</td><td class="sun">4</td></tr>
10 years, 4 months
[fedocal] master: Get monthly calendar for specific year/month, test with full output (b4959ca)
by Johan Cwiklinski
Repository : http://git.fedorahosted.org/cgit/fedocal.git
On branch : master
>---------------------------------------------------------------
commit b4959caf3e10d879ee628534adf382d308c2ed2c
Author: Johan Cwiklinski <johan(a)x-tnd.be>
Date: Sun Nov 4 13:27:05 2012 +0100
Get monthly calendar for specific year/month, test with full output
>---------------------------------------------------------------
fedocal/fedocallib/__init__.py | 18 +++++++++++++++---
fedocal/tests/test_fedocallib.py | 19 +++++++++++++------
2 files changed, 28 insertions(+), 9 deletions(-)
diff --git a/fedocal/fedocallib/__init__.py b/fedocal/fedocallib/__init__.py
index 3f1080e..c8d6ff0 100644
--- a/fedocal/fedocallib/__init__.py
+++ b/fedocal/fedocallib/__init__.py
@@ -514,8 +514,20 @@ def add_meetings_to_vcal(ical, meetings):
for meeting in meetings:
add_meeting_to_vcal(ical, meeting)
-def get_html_monthly_cal():
+def get_html_monthly_cal(month = None, year = None):
+ """ Display a monthly calendar as HTML.
+
+ :arg month: optionnal month. Defaults to current month
+ :arg year: optionnal year. Defaults to current year.
+ """
+ if year is None or month is None:
+ curdate = date.today()
+ if year is None:
+ year = curdate.year
+
+ if month is None:
+ month = curdate.month
+
htmlcal = pycalendar.HTMLCalendar()
- curdate = date.today()
- curmonth_cal_nf = htmlcal.formatmonth(curdate.year, curdate.month)
+ curmonth_cal_nf = htmlcal.formatmonth(year, month)
return curmonth_cal_nf
diff --git a/fedocal/tests/test_fedocallib.py b/fedocal/tests/test_fedocallib.py
index 27e4655..a55c7c3 100644
--- a/fedocal/tests/test_fedocallib.py
+++ b/fedocal/tests/test_fedocallib.py
@@ -48,6 +48,17 @@ import fedocallib
from fedocallib import model
from tests import Modeltests
+result_201211_html = """
+<table border="0" cellpadding="0" cellspacing="0" class="month">
+<tr><th colspan="7" class="month">November 2012</th></tr>
+<tr><th class="mon">Mon</th><th class="tue">Tue</th><th class="wed">Wed</th><th class="thu">Thu</th><th class="fri">Fri</th><th class="sat">Sat</th><th class="sun">Sun</th></tr>
+<tr><td class="noday"> </td><td class="noday"> </td><td class="noday"> </td><td class="thu">1</td><td class="fri">2</td><td class="sat">3</td><td class="sun">4</td></tr>
+<tr><td class="mon">5</td><td class="tue">6</td><td class="wed">7</td><td class="thu">8</td><td class="fri">9</td><td class="sat">10</td><td class="sun">11</td></tr>
+<tr><td class="mon">12</td><td class="tue">13</td><td class="wed">14</td><td class="thu">15</td><td class="fri">16</td><td class="sat">17</td><td class="sun">18</td></tr>
+<tr><td class="mon">19</td><td class="tue">20</td><td class="wed">21</td><td class="thu">22</td><td class="fri">23</td><td class="sat">24</td><td class="sun">25</td></tr>
+<tr><td class="mon">26</td><td class="tue">27</td><td class="wed">28</td><td class="thu">29</td><td class="fri">30</td><td class="noday"> </td><td class="noday"> </td></tr>
+</table>
+"""
class FakeUser(object):
""" Fake user used to test the fedocallib library. """
@@ -698,12 +709,8 @@ class Fedocallibtests(Modeltests):
def test_get_html_monthly_cal(self):
""" Test the get_html_monthly_call function. """
- output = fedocallib.get_html_monthly_cal()
- self.assertTrue(output.startswith('<table border="0" '\
- 'cellpadding="0" cellspacing="0" class="month">\n<tr><th '\
- 'colspan="7" class="month">'))
- self.assertTrue(output.endswith('<td class="noday"> </td>'\
- '<td class="noday"> </td></tr>\n</table>\n'))
+ output = fedocallib.get_html_monthly_cal(11, 2012)
+ self.assertEqual(output.strip(), result_201211_html.strip())
if __name__ == '__main__':
10 years, 4 months
[fedocal] master: Missing closing parenthesis (9526a0f)
by Johan Cwiklinski
Repository : http://git.fedorahosted.org/cgit/fedocal.git
On branch : master
>---------------------------------------------------------------
commit 9526a0ff54f3f376a45ba9fd761c539dbfadd282
Author: Johan Cwiklinski <johan(a)x-tnd.be>
Date: Sun Nov 4 13:04:49 2012 +0100
Missing closing parenthesis
>---------------------------------------------------------------
fedocal/tests/test_fedocallib.py | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/fedocal/tests/test_fedocallib.py b/fedocal/tests/test_fedocallib.py
index fefec75..27e4655 100644
--- a/fedocal/tests/test_fedocallib.py
+++ b/fedocal/tests/test_fedocallib.py
@@ -703,7 +703,7 @@ class Fedocallibtests(Modeltests):
'cellpadding="0" cellspacing="0" class="month">\n<tr><th '\
'colspan="7" class="month">'))
self.assertTrue(output.endswith('<td class="noday"> </td>'\
- '<td class="noday"> </td></tr>\n</table>\n')
+ '<td class="noday"> </td></tr>\n</table>\n'))
if __name__ == '__main__':
10 years, 4 months
[fedocal] master: Fix the test of the get_html_monthly_call function (3ad5472)
by Pierre-YvesChibon
Repository : http://git.fedorahosted.org/cgit/fedocal.git
On branch : master
>---------------------------------------------------------------
commit 3ad5472e9a500c3c3a55dfbbc80e9ee85c8d25dc
Author: Pierre-Yves Chibon <pingou(a)pingoured.fr>
Date: Sun Nov 4 12:37:07 2012 +0100
Fix the test of the get_html_monthly_call function
>---------------------------------------------------------------
fedocal/tests/test_fedocallib.py | 8 +++++++-
1 files changed, 7 insertions(+), 1 deletions(-)
diff --git a/fedocal/tests/test_fedocallib.py b/fedocal/tests/test_fedocallib.py
index b5e1ee8..fefec75 100644
--- a/fedocal/tests/test_fedocallib.py
+++ b/fedocal/tests/test_fedocallib.py
@@ -697,7 +697,13 @@ class Fedocallibtests(Modeltests):
self.assertEqual(len(obj), 0)
def test_get_html_monthly_cal(self):
- self.assertEqual('string' in output)
+ """ Test the get_html_monthly_call function. """
+ output = fedocallib.get_html_monthly_cal()
+ self.assertTrue(output.startswith('<table border="0" '\
+ 'cellpadding="0" cellspacing="0" class="month">\n<tr><th '\
+ 'colspan="7" class="month">'))
+ self.assertTrue(output.endswith('<td class="noday"> </td>'\
+ '<td class="noday"> </td></tr>\n</table>\n')
if __name__ == '__main__':
10 years, 4 months
[fedocal] rewrite_recursive: Start refactoring the recursion in the meeting (96926f4)
by pingou@fedorahosted.org
Repository : http://git.fedorahosted.org/cgit/fedocal.git
On branch : rewrite_recursive
>---------------------------------------------------------------
commit 96926f46725af459261f99c66f1c708a52b051fd
Author: Pierre-Yves Chibon <pingou(a)pingoured.fr>
Date: Sun Nov 4 12:15:20 2012 +0100
Start refactoring the recursion in the meeting
>---------------------------------------------------------------
Diff suppressed because of size. To see it, use:
git diff --patch-with-stat --no-color --find-copies-harder --ignore-space-at-eol ^96926f46725af459261f99c66f1c708a52b051fd~1 96926f46725af459261f99c66f1c708a52b051fd
10 years, 4 months