Skip to content
This repository has been archived by the owner on Oct 1, 2020. It is now read-only.

Commit

Permalink
yapf
Browse files Browse the repository at this point in the history
  • Loading branch information
monty5811 committed May 9, 2016
1 parent e629d48 commit 9c4b086
Show file tree
Hide file tree
Showing 10 changed files with 23 additions and 43 deletions.
6 changes: 2 additions & 4 deletions apostello/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -142,8 +142,7 @@ def personalise(self, message):
return message.replace('%name%', self.first_name)

def send_message(
self,
content='test message',
self, content='test message',
group=None,
sent_by='',
eta=None
Expand Down Expand Up @@ -308,8 +307,7 @@ class Keyword(models.Model):
)
last_email_sent_time = models.DateTimeField(
"Time of last sent email",
blank=True,
null=True
blank=True, null=True
)

def construct_reply(self, sender):
Expand Down
21 changes: 7 additions & 14 deletions apostello/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -167,8 +167,7 @@
),
url(
r'^keyword/responses/archive/(?P<pk>\d+)/$',
v.keyword_responses,
{'archive': True},
v.keyword_responses, {'archive': True},
name='keyword_responses_archive'
),
url(
Expand Down Expand Up @@ -234,8 +233,7 @@
url(
r'^elvanto/',
include(
'elvanto.urls',
namespace='elvanto'
'elvanto.urls', namespace='elvanto'
)
)
]
Expand Down Expand Up @@ -273,22 +271,17 @@
url(
r'^config/',
include(
'site_config.urls',
namespace='site_config'
'site_config.urls', namespace='site_config'
)
),
url(
r'^graphs/',
include(
'graphs.urls',
namespace='graphs'
r'^graphs/', include(
'graphs.urls', namespace='graphs'
)
),
url(
r'^api/',
include(
'api.urls',
namespace='api'
r'^api/', include(
'api.urls', namespace='api'
)
),
]
3 changes: 1 addition & 2 deletions elvanto/elvanto.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,7 @@ def elvanto(end_point, **kwargs):
base_url = 'https://api.elvanto.com/v1/'
e_url = '{0}{1}.json'.format(base_url, end_point)
resp = retry_request(
e_url,
'post',
e_url, 'post',
json=kwargs,
auth=(settings.ELVANTO_KEY, '_')
)
Expand Down
3 changes: 2 additions & 1 deletion graphs/renderers.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@
)
from graphs.sms_freq import sms_graph_data

clean_style_large_text = CleanStyle(legend_font_size=30, tooltip_font_size=30,)
clean_style_large_text = CleanStyle(legend_font_size=30,
tooltip_font_size=30, )


def recent():
Expand Down
3 changes: 1 addition & 2 deletions site_config/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@

urlpatterns = [
url(
r'^site/',
views.SiteConfigView.as_view(),
r'^site/', views.SiteConfigView.as_view(),
name='site'
),
url(
Expand Down
12 changes: 4 additions & 8 deletions tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -333,10 +333,8 @@ def users(recipients, keywords):
user.is_staff = True
user.save()
allauth_email = EmailAddress.objects.create(
user=user,
email=user.email,
primary=True,
verified=True
user=user, email=user.email,
primary=True, verified=True
)
allauth_email.save()
p = UserProfile.objects.get(user=user)
Expand All @@ -360,8 +358,7 @@ def users(recipients, keywords):
p.approved = True
p.save()
allauth_email = EmailAddress.objects.create(
user=user2,
email=user2.email,
user=user2, email=user2.email,
primary=True,
verified=True
)
Expand All @@ -381,8 +378,7 @@ def users(recipients, keywords):
user3.profile.approved = True
user3.profile.save()
allauth_email = EmailAddress.objects.create(
user=user3,
email=user3.email,
user=user3, email=user3.email,
primary=True,
verified=True
)
Expand Down
6 changes: 2 additions & 4 deletions tests/models/test_recipient_group.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,10 @@ def test_display(self, groups):
@twilio_vcr
def test_sending(self, groups):
groups['test_group'].send_message(
content='test content',
sent_by="user"
content='test content', sent_by="user"
)
groups['empty_group'].send_message(
content='test content',
sent_by="user"
content='test content', sent_by="user"
)

def test_all_recipients_names(self, groups):
Expand Down
3 changes: 1 addition & 2 deletions tests/test_tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,7 @@ def test_send_group(self):
group_send_message_task(
"This is another test",
"Test group",
'test',
eta=None
'test', eta=None
)

@twilio_vcr
Expand Down
6 changes: 2 additions & 4 deletions tests/test_twilio_view.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,7 @@ def get(self, path, data=None, **extra):
extra.update(
{
'HTTP_X_TWILIO_SIGNATURE': self._compute_signature(
path,
params=data
path, params=data
)
}
)
Expand All @@ -49,8 +48,7 @@ def post(self, path, data=None, content_type=None, **extra):
extra.update(
{
'HTTP_X_TWILIO_SIGNATURE': self._compute_signature(
path,
params=data
path, params=data
)
}
)
Expand Down
3 changes: 1 addition & 2 deletions tests/test_urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -294,8 +294,7 @@ def test_bring_group_from_archive(self, groups, users):
def test_edit_group(self, users):
"""Test editing a group."""
new_group = models.RecipientGroup.objects.create(
name='t1',
description='t1'
name='t1', description='t1'
)
new_group.save()
pk = new_group.pk
Expand Down

0 comments on commit 9c4b086

Please sign in to comment.