flake8 fixes

This commit is contained in:
Sheila Miguez 2014-09-21 21:11:12 -05:00
parent 51709c6eaf
commit 0ebcc2f124
4 changed files with 12 additions and 9 deletions

View file

@ -11,8 +11,9 @@ from symposion.conference.models import Section, Conference
class ConferenceFactory(factory.DjangoModelFactory): class ConferenceFactory(factory.DjangoModelFactory):
title = fuzzy.FuzzyText() title = fuzzy.FuzzyText()
start_date = fuzzy.FuzzyDate(datetime.date(2014, 1, 1)) start_date = fuzzy.FuzzyDate(datetime.date(2014, 1, 1))
end_date = fuzzy.FuzzyDate(datetime.date(2014, 1, 1) + datetime.timedelta(days=random.randint(1,10))) end_date = fuzzy.FuzzyDate(datetime.date(2014, 1, 1)
#timezone = TimeZoneField("UTC") + datetime.timedelta(days=random.randint(1, 10)))
# timezone = TimeZoneField("UTC")
class Meta: class Meta:
model = Conference model = Conference
@ -55,8 +56,8 @@ class DayFactory(factory.DjangoModelFactory):
class SlotFactory(factory.DjangoModelFactory): class SlotFactory(factory.DjangoModelFactory):
day = factory.SubFactory(DayFactory) day = factory.SubFactory(DayFactory)
kind = factory.SubFactory(SlotKindFactory) kind = factory.SubFactory(SlotKindFactory)
start = datetime.time(random.randint(0,23), random.randint(0,59)) start = datetime.time(random.randint(0, 23), random.randint(0, 59))
end = datetime.time(random.randint(0,23), random.randint(0,59)) end = datetime.time(random.randint(0, 23), random.randint(0, 59))
class Meta: class Meta:
model = Slot model = Slot

View file

@ -17,7 +17,6 @@ class ScheduleViewTests(TestCase):
assert 'schedule' in conference assert 'schedule' in conference
assert len(conference['schedule']) == 0 assert len(conference['schedule']) == 0
def test_populated_empty_presentations(self): def test_populated_empty_presentations(self):
factories.SlotFactory.create_batch(size=5) factories.SlotFactory.create_batch(size=5)

View file

@ -164,7 +164,10 @@ def schedule_presentation_detail(request, pk):
def schedule_json(request): def schedule_json(request):
slots = Slot.objects.filter(day__schedule__published=True, day__schedule__hidden=False).order_by("start") slots = Slot.objects.filter(
day__schedule__published=True,
day__schedule__hidden=False
).order_by("start")
protocol = request.META.get('HTTP_X_FORWARDED_PROTO', 'http') protocol = request.META.get('HTTP_X_FORWARDED_PROTO', 'http')
data = [] data = []