Skip to content

Commit

Permalink
mix fixes for pytest support
Browse files Browse the repository at this point in the history
  • Loading branch information
areski committed Sep 24, 2014
1 parent 92496e1 commit b6d87e3
Show file tree
Hide file tree
Showing 18 changed files with 255 additions and 247 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
*devserver*
*.idea*
*.egg
*.egg-info
test.db
newfies/settings_local.py
newfies/newfies_dialer/settings_local.py
Expand Down
2 changes: 1 addition & 1 deletion install/requirements/django-requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ django-admin-tools==0.5.2
django-country-dialcode==0.5.1
django-audiofield==0.6.3
django-admin-tools-stats==0.5.5
django-lets-go==2.9.1
django-lets-go==2.9.3
django-extensions==1.4.0
django-nvd3==0.7.5
git+git://github.com/Star2Billing/django-notification
Expand Down
133 changes: 67 additions & 66 deletions newfies/appointment/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,81 +17,82 @@


class EVENT_STATUS(Choice):
PENDING = 1, _('pending').upper()
COMPLETED = 2, _('completed').upper()
PAUSED = 3, _('paused').upper()
PENDING = 1, _('PENDING')
COMPLETED = 2, _('COMPLETED')
PAUSED = 3, _('PAUSED')


class ALARM_STATUS(Choice):
PENDING = 1, _('pending').upper()
IN_PROCESS = 2, _('in_process').upper()
FAILURE = 3, _("failure").upper()
RETRY = 4, _('retry').upper()
SUCCESS = 5, _('success').upper()
PENDING = 1, _('PENDING')
IN_PROCESS = 2, _('IN_PROCESS')
FAILURE = 3, _("FAILURE")
RETRY = 4, _('RETRY')
SUCCESS = 5, _('SUCCESS')


class ALARM_RESULT(Choice):
NORESULT = 0, _('no result').upper()
CONFIRMED = 1, _('confirmed').upper()
CANCELLED = 2, _('cancelled').upper()
RESCHEDULED = 3, _('rescheduled').upper()
NORESULT = 0, _('NO RESULT')
CONFIRMED = 1, _('CONFIRMED')
CANCELLED = 2, _('CANCELLED')
RESCHEDULED = 3, _('RESCHEDULED')


class ALARM_METHOD(Choice):
CALL = 1, _('call').upper()
SMS = 2, _('sms').upper()
EMAIL = 3, _('email').upper()
CALL = 1, _('CALL')
SMS = 2, _('SMS')
EMAIL = 3, _('EMAIL')


class ALARMREQUEST_STATUS(Choice):
PENDING = 1, _("pending").upper()
IN_PROCESS = 2, _("in_process").upper()
FAILURE = 3, _("failure").upper()
RETRY = 4, _("retry").upper()
SUCCESS = 5, _("success").upper()


class CALENDAR_SETTING_COLUMN_NAME(Choice):
label = _('label')
callerid = _('caller ID Number')
caller_name = _('caller ID Name')
call_timeout = _('call Timeout')
survey = _('survey')
aleg_gateway = _('A-leg Gateway')
sms_gateway = _('SMS Gateway')


class CALENDAR_USER_COLUMN_NAME(Choice):
name = _('name')
email = _('email')
calendar_setting = _('Calendar Setting')
date = _('date')


class CALENDAR_COLUMN_NAME(Choice):
name = _('name')
user = _('calendar user')
max_concurrent = _('max concurrent')
created_date = _('date')


class EVENT_COLUMN_NAME(Choice):
start = _('start')
end = _('end')
title = _('title')
end_recurring_period = _('end period')
calendar = _('calendar')
status = _('status')
created_on = _('date')


class ALARM_COLUMN_NAME(Choice):
alarm_phonenumber = _('phone number')
alarm_email = _('email')
daily_start = _('daily start')
daily_stop = _('daily stop')
method = _('method')
survey = _('survey')
event = _('event')
date_start_notice = _('start notice')
status = _('status')
PENDING = 1, _("PENDING")
IN_PROCESS = 2, _("IN PROCESS")
FAILURE = 3, _("FAILURE")
RETRY = 4, _("RETRY")
SUCCESS = 5, _("SUCCESS")


CALENDAR_SETTING_COLUMN_NAME = {
'label': _('label'),
'callerid': _('caller ID Number'),
'caller_name': _('caller ID Name'),
'call_timeout': _('call Timeout'),
'survey': _('survey'),
'aleg_gateway': _('A-leg Gateway'),
'sms_gateway': _('SMS Gateway')
}

CALENDAR_USER_COLUMN_NAME = {
'name': _('name'),
'email': _('email'),
'calendar_setting': _('Calendar Setting'),
'date': _('date')
}

CALENDAR_COLUMN_NAME = {
'name': _('name'),
'user': _('calendar user'),
'max_concurrent': _('max concurrent'),
'created_date': _('date')
}

EVENT_COLUMN_NAME = {
'start': _('start'),
'end': _('end'),
'title': _('title'),
'end_recurring_period': _('end period'),
'calendar': _('calendar'),
'status': _('status'),
'created_on': _('date')
}

ALARM_COLUMN_NAME = {
'alarm_phonenumber': _('phone number'),
'alarm_email': _('email'),
'daily_start': _('daily start'),
'daily_stop': _('daily stop'),
'method': _('method'),
'survey': _('survey'),
'event': _('event'),
'date_start_notice': _('start notice'),
'status': _('status')
}
22 changes: 11 additions & 11 deletions newfies/appointment/forms.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
from django import forms
from django.forms import ModelForm
from django.conf import settings
from django.utils.translation import ugettext as _
from django.utils.translation import ugettext_lazy as _
from django.contrib.auth.forms import UserCreationForm, AdminPasswordChangeForm, UserChangeForm
from appointment.models.users import CalendarUserProfile, CalendarUser, CalendarSetting
from appointment.models.events import Event
Expand Down Expand Up @@ -58,7 +58,7 @@ def __init__(self, manager, *args, **kwargs):
)
cal_setting_list = []
setting_list = CalendarSetting.objects.filter(user=manager)
cal_setting_list.append(('', _('select calendar setting').title()))
cal_setting_list.append(('', _('Select Calendar Setting')))
for i in setting_list:
cal_setting_list.append((i.id, i.label))
self.fields['calendar_setting_id'].choices = cal_setting_list
Expand All @@ -69,7 +69,7 @@ class CalendarUserChangeDetailExtendForm(ModelForm):

class Meta:
model = CalendarUserProfile
exclude = ('manager', 'user', )
exclude = ('manager', 'user',)

def __init__(self, user, *args, **kwargs):
super(CalendarUserChangeDetailExtendForm, self).__init__(*args, **kwargs)
Expand All @@ -96,7 +96,7 @@ def __init__(self, user, *args, **kwargs):
),
)
list_calendar_setting = []
list_calendar_setting.append((0, _('select calendar setting').title()))
list_calendar_setting.append((0, _('Select Calendar Setting')))
for l in CalendarSetting.objects.filter(user=user).order_by('id'):
list_calendar_setting.append((l.id, l.label))
self.fields['calendar_setting'].choices = list_calendar_setting
Expand Down Expand Up @@ -260,7 +260,7 @@ def __init__(self, user, *args, **kwargs):
self.helper.form_class = 'well'
css_class = 'col-md-6'
self.helper.layout = Layout(
Fieldset(_('event settings').capitalize()),
Fieldset(_('Event Settings')),
Div(
Div('title', css_class=css_class),
Div('calendar', css_class=css_class),
Expand Down Expand Up @@ -291,10 +291,10 @@ def __init__(self, user, *args, **kwargs):
class EventSearchForm(forms.Form):
"""Event Search Form"""
start_date = forms.CharField(
label=_('start date').capitalize(), required=False, max_length=20,
label=_('Start Date'), required=False, max_length=20,
widget=DateTimePicker(options={"format": "YYYY-MM-DD HH:mm:ss"}))
calendar_id = forms.ChoiceField(label=_('calendar').capitalize(), required=False, choices=[('0', '---')])
calendar_user_id = forms.ChoiceField(label=_('calendar user').capitalize(), required=False, choices=[('0', '---')])
calendar_id = forms.ChoiceField(label=_('Calendar'), required=False, choices=[('0', '---')])
calendar_user_id = forms.ChoiceField(label=_('Calendar User'), required=False, choices=[('0', '---')])

def __init__(self, user, *args, **kwargs):
super(EventSearchForm, self).__init__(*args, **kwargs)
Expand Down Expand Up @@ -337,7 +337,7 @@ def __init__(self, user, *args, **kwargs):
css_class = 'col-md-6'
self.helper.layout = Layout(
TabHolder(
Tab(_('general settings').title(),
Tab(_('General Settings'),
Div(
Div('date_start_notice', css_class=css_class),
Div('event', css_class=css_class),
Expand All @@ -352,7 +352,7 @@ def __init__(self, user, *args, **kwargs):
form_action,
css_class='well'
),
Tab(_('alarm settings').title(),
Tab(_('Alarm Settings'),
Div(
Div('daily_start', css_class=css_class),
Div('daily_stop', css_class=css_class),
Expand All @@ -364,7 +364,7 @@ def __init__(self, user, *args, **kwargs):
form_action,
css_class='well'
),
Tab(_('result settings').title(),
Tab(_('Result Settings'),
Div(
Div('result', css_class=css_class),
Div('url_cancel', css_class=css_class),
Expand Down
53 changes: 27 additions & 26 deletions newfies/dialer_campaign/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,34 @@
# Arezqui Belaid <[email protected]>
#

from django.utils.translation import ugettext_lazy as _
from django_lets_go.utils import Choice
from django.utils.translation import ugettext_lazy as _


CAMPAIGN_STATUS_COLOR = {1: "green", 2: "blue", 3: "orange", 4: "red"}

CAMPAIGN_COLUMN_NAME = {
'key': _('key'),
'name': _('name'),
'start_date': _('start date'),
'type': _('type'),
'app': _('app'),
'contacts': _('contacts'),
'status': _('status'),
'frequency': _('frequency'),
'phonebook': _('phonebook')
}

SUBSCRIBER_COLUMN_NAME = {
'contact': _('contact'),
'updated_date': _('date'),
'count_attempt': _('attempts'),
'completion_count_attempt': _('completion attempts'),
'status': _('status'),
'disposition': _('disposition'),
'collected_data': _('response'),
'agent': _('agent')
}


class SUBSCRIBER_STATUS(Choice):
Expand Down Expand Up @@ -44,33 +70,8 @@ class CAMPAIGN_STATUS(Choice):
ABORT = 3, _('ABORT')
END = 4, _('END')

CAMPAIGN_STATUS_COLOR = {1: "green", 2: "blue", 3: "orange", 4: "red"}


class CAMPAIGN_COLUMN_NAME(Choice):
key = _('key')
name = _('name')
start_date = _('start date')
type = _('type')
app = _('app')
contacts = _('contacts')
status = _('status')
frequency = _('frequency')
phonebook = _('phonebook')


class AMD_BEHAVIOR(Choice):
ALWAYS = 1, _('ALWAYS PLAY MESSAGE')
HUMAN_ONLY = 2, _('PLAY MESSAGE TO HUMAN ONLY')
VOICEMAIL_ONLY = 3, _('LEAVE MESSAGE TO VOICEMAIL ONLY')


class SUBSCRIBER_COLUMN_NAME(Choice):
contact = _('contact')
updated_date = _('date')
count_attempt = _('attempts')
completion_count_attempt = _('completion attempts')
status = _('status')
disposition = _('disposition')
collected_data = _('response')
agent = _('agent')
47 changes: 23 additions & 24 deletions newfies/dialer_cdr/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,13 @@ class CALLREQUEST_STATUS(Choice):
"""
Store the Call Request Status
"""
PENDING = 1, _("pending").capitalize()
FAILURE = 2, _("failure").capitalize()
RETRY = 3, _("retry").capitalize()
SUCCESS = 4, _("success").capitalize()
ABORT = 5, _("abort").capitalize()
PAUSE = 6, _("pause").capitalize()
CALLING = 7, _("calling").capitalize()
PENDING = 1, _("pending")
FAILURE = 2, _("failure")
RETRY = 3, _("retry")
SUCCESS = 4, _("success")
ABORT = 5, _("abort")
PAUSE = 6, _("pause")
CALLING = 7, _("calling")


class CALLREQUEST_TYPE(Choice):
Expand Down Expand Up @@ -58,26 +58,25 @@ class CALL_DISPOSITION(Choice):
FAILED = 'FAILED', _('FAILED') # Added to catch all


class CDR_REPORT_COLUMN_NAME(Choice):
"""
Column Name for the CDR Report
"""
date = _('start date')
call_id = _('call ID')
leg = _('leg')
caller_id = _('caller ID')
phone_no = _('phone no')
gateway = _('gateway')
duration = _('duration')
bill_sec = _('bill sec')
disposition = _('disposition')
amd_status = _('amd status')
#Column Name for the CDR Report
CDR_REPORT_COLUMN_NAME = {
'date': _('start date'),
'call_id': _('call ID'),
'leg': _('leg'),
'caller_id': _('caller ID'),
'phone_no': _('phone no'),
'gateway': _('gateway'),
'duration': _('duration'),
'bill_sec': _('bill sec'),
'disposition': _('disposition'),
'amd_status': _('amd status')
}


class VOIPCALL_AMD_STATUS(Choice):
"""
Store the AMD Status
"""
PERSON = 1, _("person").capitalize()
MACHINE = 2, _("machine").capitalize()
UNSURE = 3, _("unsure").capitalize()
PERSON = 1, _("PERSON")
MACHINE = 2, _("MACHINE")
UNSURE = 3, _("UNSURE")
Loading

0 comments on commit b6d87e3

Please sign in to comment.