removing some warnings
This commit is contained in:
@@ -10,7 +10,6 @@ nu = datetime.datetime.now()
|
||||
|
||||
from rowers.views import *
|
||||
|
||||
|
||||
class WorkoutCompareTest(TestCase):
|
||||
def setUp(self):
|
||||
self.u = UserFactory()
|
||||
@@ -212,6 +211,9 @@ class ListWorkoutTest(TestCase):
|
||||
startdate = (self.user_workouts[0].startdatetime-datetime.timedelta(days=3)).date()
|
||||
enddate = (self.user_workouts[0].startdatetime+datetime.timedelta(days=3)).date()
|
||||
|
||||
startdate = arrow.get(startdate).datetime
|
||||
enddate = arrow.get(startdate).datetime
|
||||
|
||||
form_data = {
|
||||
'startdate':startdate,
|
||||
'enddate':enddate,
|
||||
@@ -345,6 +347,16 @@ class CumStatsTest(TestCase):
|
||||
startdate = (self.user_workouts[0].startdatetime-datetime.timedelta(days=3)).date()
|
||||
enddate = (self.user_workouts[0].startdatetime+datetime.timedelta(days=3)).date()
|
||||
|
||||
# make sure the dates are not naive
|
||||
try:
|
||||
startdate = pytz.utc.localize(startdate)
|
||||
except (ValueError, AttributeError):
|
||||
pass
|
||||
try:
|
||||
enddate = pytz.utc.localize(enddate)
|
||||
except (ValueError, AttributeError):
|
||||
pass
|
||||
|
||||
url = '/rowers/cumstats/'
|
||||
response = self.c.get(url)
|
||||
|
||||
@@ -382,6 +394,16 @@ class CumFlexTest(TestCase):
|
||||
startdate = (self.user_workouts[0].startdatetime-datetime.timedelta(days=3)).date()
|
||||
enddate = (self.user_workouts[0].startdatetime+datetime.timedelta(days=3)).date()
|
||||
|
||||
# make sure the dates are not naive
|
||||
try:
|
||||
startdate = pytz.utc.localize(startdate)
|
||||
except (ValueError, AttributeError):
|
||||
pass
|
||||
try:
|
||||
enddate = pytz.utc.localize(enddate)
|
||||
except (ValueError, AttributeError):
|
||||
pass
|
||||
|
||||
waterboattype = [u'1x',
|
||||
u'2x',
|
||||
u'2x+',
|
||||
@@ -402,7 +424,7 @@ class CumFlexTest(TestCase):
|
||||
'modality':u'all',
|
||||
'waterboattype': waterboattype,
|
||||
'xaxis':'spm',
|
||||
'yaxis1':'driveenergy',
|
||||
'yaxis1':'hr',
|
||||
'yaxis2':'power',
|
||||
}
|
||||
|
||||
@@ -442,7 +464,7 @@ class CumFlexTest(TestCase):
|
||||
u'8+',
|
||||
u'8x+'],
|
||||
'xparam': u'spm',
|
||||
'yparam1': u'driveenergy',
|
||||
'yparam1': u'hr',
|
||||
'yparam2': u'power'}
|
||||
|
||||
session = self.c.session
|
||||
@@ -487,6 +509,16 @@ class MultiFlexTest(TestCase):
|
||||
startdate = (self.user_workouts[0].startdatetime-datetime.timedelta(days=3)).date()
|
||||
enddate = (self.user_workouts[0].startdatetime+datetime.timedelta(days=3)).date()
|
||||
|
||||
# make sure the dates are not naive
|
||||
try:
|
||||
startdate = pytz.utc.localize(startdate)
|
||||
except (ValueError, AttributeError):
|
||||
pass
|
||||
try:
|
||||
enddate = pytz.utc.localize(enddate)
|
||||
except (ValueError, AttributeError):
|
||||
pass
|
||||
|
||||
waterboattype = [u'1x',
|
||||
u'2x',
|
||||
u'2x+',
|
||||
@@ -516,7 +548,7 @@ class MultiFlexTest(TestCase):
|
||||
'workoutselectform':'Create Chart',
|
||||
'xparam':'spm',
|
||||
'yparam':'power',
|
||||
'groupby':'driveenergy',
|
||||
'groupby':'spm',
|
||||
}
|
||||
|
||||
form = MultiFlexChoiceForm(form_data)
|
||||
@@ -536,7 +568,7 @@ class MultiFlexTest(TestCase):
|
||||
'ploterrorbars':True,
|
||||
'userid':0,
|
||||
'palette': 'monochrome_blue',
|
||||
'groupby': 'driveenergy',
|
||||
'groupby': 'power',
|
||||
'binsize': 1,
|
||||
'xparam': 'spm',
|
||||
'yparam': 'power',
|
||||
@@ -592,6 +624,16 @@ class HistoTest(TestCase):
|
||||
startdate = (self.user_workouts[0].startdatetime-datetime.timedelta(days=3)).date()
|
||||
enddate = (self.user_workouts[0].startdatetime+datetime.timedelta(days=3)).date()
|
||||
|
||||
# make sure the dates are not naive
|
||||
try:
|
||||
startdate = pytz.utc.localize(startdate)
|
||||
except (ValueError, AttributeError):
|
||||
pass
|
||||
try:
|
||||
enddate = pytz.utc.localize(enddate)
|
||||
except (ValueError, AttributeError):
|
||||
pass
|
||||
|
||||
waterboattype = [u'1x',
|
||||
u'2x',
|
||||
u'2x+',
|
||||
@@ -694,6 +736,16 @@ class WorkoutCompareTestNew(TestCase):
|
||||
startdate = (self.user_workouts[0].startdatetime-datetime.timedelta(days=3)).date()
|
||||
enddate = (self.user_workouts[0].startdatetime+datetime.timedelta(days=3)).date()
|
||||
|
||||
# make sure the dates are not naive
|
||||
try:
|
||||
startdate = pytz.utc.localize(startdate)
|
||||
except (ValueError, AttributeError):
|
||||
pass
|
||||
try:
|
||||
enddate = pytz.utc.localize(enddate)
|
||||
except (ValueError, AttributeError):
|
||||
pass
|
||||
|
||||
form_data = {
|
||||
'function':'compare',
|
||||
'xparam':'hr',
|
||||
@@ -783,6 +835,16 @@ class WorkoutBoxPlotTestNew(TestCase):
|
||||
startdate = (self.user_workouts[0].startdatetime-datetime.timedelta(days=3)).date()
|
||||
enddate = (self.user_workouts[0].startdatetime+datetime.timedelta(days=3)).date()
|
||||
|
||||
# make sure the dates are not naive
|
||||
try:
|
||||
startdate = pytz.utc.localize(startdate)
|
||||
except (ValueError, AttributeError):
|
||||
pass
|
||||
try:
|
||||
enddate = pytz.utc.localize(enddate)
|
||||
except (ValueError, AttributeError):
|
||||
pass
|
||||
|
||||
form_data = {
|
||||
'function':'boxplot',
|
||||
'xparam':'hr',
|
||||
@@ -871,6 +933,16 @@ class WorkoutHistoTestNew(TestCase):
|
||||
startdate = (self.user_workouts[0].startdatetime-datetime.timedelta(days=3)).date()
|
||||
enddate = (self.user_workouts[0].startdatetime+datetime.timedelta(days=3)).date()
|
||||
|
||||
# make sure the dates are not naive
|
||||
try:
|
||||
startdate = pytz.utc.localize(startdate)
|
||||
except (ValueError, AttributeError):
|
||||
pass
|
||||
try:
|
||||
enddate = pytz.utc.localize(enddate)
|
||||
except (ValueError, AttributeError):
|
||||
pass
|
||||
|
||||
form_data = {
|
||||
'function':'histo',
|
||||
'xparam':'hr',
|
||||
@@ -964,6 +1036,16 @@ class History(TestCase):
|
||||
startdate = (self.user_workouts[0].startdatetime-datetime.timedelta(days=50)).date()
|
||||
enddate = (self.user_workouts[0].startdatetime+datetime.timedelta(days=50)).date()
|
||||
|
||||
# make sure the dates are not naive
|
||||
try:
|
||||
startdate = pytz.utc.localize(startdate)
|
||||
except (ValueError, AttributeError):
|
||||
pass
|
||||
try:
|
||||
enddate = pytz.utc.localize(enddate)
|
||||
except (ValueError, AttributeError):
|
||||
pass
|
||||
|
||||
form_data = {
|
||||
'startdate':startdate,
|
||||
'enddate':enddate,
|
||||
@@ -1061,6 +1143,16 @@ class GoldMedalScores(TestCase):
|
||||
startdate = (self.user_workouts[0].startdatetime-datetime.timedelta(days=50)).date()
|
||||
enddate = (self.user_workouts[0].startdatetime+datetime.timedelta(days=50)).date()
|
||||
|
||||
# make sure the dates are not naive
|
||||
try:
|
||||
startdate = pytz.utc.localize(startdate)
|
||||
except (ValueError, AttributeError):
|
||||
pass
|
||||
try:
|
||||
enddate = pytz.utc.localize(enddate)
|
||||
except (ValueError, AttributeError):
|
||||
pass
|
||||
|
||||
form_data = {
|
||||
'startdate':startdate,
|
||||
'enddate':enddate,
|
||||
@@ -1126,6 +1218,16 @@ class WorkoutFlexallTestNew(TestCase):
|
||||
startdate = (self.user_workouts[0].startdatetime-datetime.timedelta(days=3)).date()
|
||||
enddate = (self.user_workouts[0].startdatetime+datetime.timedelta(days=3)).date()
|
||||
|
||||
# make sure the dates are not naive
|
||||
try:
|
||||
startdate = pytz.utc.localize(startdate)
|
||||
except (ValueError, AttributeError):
|
||||
pass
|
||||
try:
|
||||
enddate = pytz.utc.localize(enddate)
|
||||
except (ValueError, AttributeError):
|
||||
pass
|
||||
|
||||
form_data = {
|
||||
'function':'flexall',
|
||||
'xparam':'hr',
|
||||
@@ -1215,6 +1317,16 @@ class WorkoutStatsTestNew(TestCase):
|
||||
startdate = (self.user_workouts[0].startdatetime-datetime.timedelta(days=3)).date()
|
||||
enddate = (self.user_workouts[0].startdatetime+datetime.timedelta(days=3)).date()
|
||||
|
||||
# make sure the dates are not naive
|
||||
try:
|
||||
startdate = pytz.utc.localize(startdate)
|
||||
except (ValueError, AttributeError):
|
||||
pass
|
||||
try:
|
||||
enddate = pytz.utc.localize(enddate)
|
||||
except (ValueError, AttributeError):
|
||||
pass
|
||||
|
||||
options = {
|
||||
'function':'flexall',
|
||||
'xparam':'hr',
|
||||
@@ -1266,6 +1378,16 @@ class WorkoutStatsTestNew(TestCase):
|
||||
startdate = (self.user_workouts[0].startdatetime-datetime.timedelta(days=3)).date()
|
||||
enddate = (self.user_workouts[0].startdatetime+datetime.timedelta(days=3)).date()
|
||||
|
||||
# make sure the dates are not naive
|
||||
try:
|
||||
startdate = pytz.utc.localize(startdate)
|
||||
except (ValueError, AttributeError):
|
||||
pass
|
||||
try:
|
||||
enddate = pytz.utc.localize(enddate)
|
||||
except (ValueError, AttributeError):
|
||||
pass
|
||||
|
||||
form_data = {
|
||||
'function':'stats',
|
||||
'xparam':'hr',
|
||||
|
||||
Reference in New Issue
Block a user