Merge lp:~daker/loco-team-portal/pep8-fixes into lp:loco-team-portal
- pep8-fixes
- Merge into 0.2
Proposed by
Adnane Belmadiaf
Status: | Merged |
---|---|
Approved by: | Adnane Belmadiaf |
Approved revision: | 588 |
Merged at revision: | 588 |
Proposed branch: | lp:~daker/loco-team-portal/pep8-fixes |
Merge into: | lp:loco-team-portal |
Diff against target: |
563 lines (+76/-57) 17 files modified
loco_directory/articles/admin.py (+1/-0) loco_directory/articles/management/commands/refresh.py (+3/-4) loco_directory/articles/models.py (+4/-5) loco_directory/articles/tests.py (+1/-0) loco_directory/articles/views.py (+1/-1) loco_directory/events/admin.py (+1/-1) loco_directory/meetings/admin.py (+1/-1) loco_directory/teams/admin.py (+6/-2) loco_directory/teams/feeds.py (+1/-4) loco_directory/teams/forms.py (+4/-5) loco_directory/teams/models.py (+9/-1) loco_directory/teams/tests.py (+9/-10) loco_directory/teams/utils.py (+1/-1) loco_directory/teams/views.py (+27/-17) loco_directory/userprofiles/admin.py (+2/-0) loco_directory/userprofiles/management/commands/update-profiles.py (+2/-3) loco_directory/userprofiles/tests.py (+3/-2) |
To merge this branch: | bzr merge lp:~daker/loco-team-portal/pep8-fixes |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
LoCo Team Portal Developers | Pending | ||
Review via email:
|
Commit message
PEP8 fixes
Description of the change
To post a comment you must log in.
Preview Diff
[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1 | === modified file 'loco_directory/articles/admin.py' |
2 | --- loco_directory/articles/admin.py 2012-06-01 22:28:09 +0000 |
3 | +++ loco_directory/articles/admin.py 2012-12-25 22:04:21 +0000 |
4 | @@ -1,3 +1,4 @@ |
5 | +# -*- coding: utf-8 -*- |
6 | from articles.models import Feed, Article |
7 | from django.contrib import admin |
8 | |
9 | |
10 | === modified file 'loco_directory/articles/management/commands/refresh.py' |
11 | --- loco_directory/articles/management/commands/refresh.py 2012-12-12 22:46:30 +0000 |
12 | +++ loco_directory/articles/management/commands/refresh.py 2012-12-25 22:04:21 +0000 |
13 | @@ -1,14 +1,13 @@ |
14 | +# -*- coding: utf-8 -*- |
15 | ''' |
16 | Updates all Feeds |
17 | ''' |
18 | +from django.core.management.base import NoArgsCommand |
19 | |
20 | +from articles.models import Feed |
21 | import os |
22 | import datetime |
23 | |
24 | -from django.core.management.base import NoArgsCommand |
25 | - |
26 | -from articles.models import Feed |
27 | - |
28 | REFRESH_LOCK = '/var/lock/loco-directory/refresh' |
29 | |
30 | |
31 | |
32 | === modified file 'loco_directory/articles/models.py' |
33 | --- loco_directory/articles/models.py 2012-12-13 22:48:12 +0000 |
34 | +++ loco_directory/articles/models.py 2012-12-25 22:04:21 +0000 |
35 | @@ -1,15 +1,14 @@ |
36 | # -*- coding: utf-8 -*- |
37 | +from django.db import models |
38 | +from django.conf import settings |
39 | +from django.template.defaultfilters import slugify |
40 | + |
41 | import feedparser |
42 | import time |
43 | import datetime |
44 | import socket |
45 | import urllib2 |
46 | |
47 | -from django.db import models |
48 | -from django.conf import settings |
49 | -from django.template.defaultfilters import slugify |
50 | - |
51 | - |
52 | from teams.models import Team |
53 | from userprofiles.models import UserProfile |
54 | |
55 | |
56 | === modified file 'loco_directory/articles/tests.py' |
57 | --- loco_directory/articles/tests.py 2012-12-11 00:00:46 +0000 |
58 | +++ loco_directory/articles/tests.py 2012-12-25 22:04:21 +0000 |
59 | @@ -1,3 +1,4 @@ |
60 | +# -*- coding: utf-8 -*- |
61 | from django.test import TestCase |
62 | |
63 | from articles.models import Feed, Article |
64 | |
65 | === modified file 'loco_directory/articles/views.py' |
66 | --- loco_directory/articles/views.py 2012-12-13 22:48:12 +0000 |
67 | +++ loco_directory/articles/views.py 2012-12-25 22:04:21 +0000 |
68 | @@ -14,4 +14,4 @@ |
69 | 'article': article, |
70 | } |
71 | return render_to_response('articles/article_detail.html', |
72 | - context, RequestContext(request)) |
73 | + context, RequestContext(request)) |
74 | |
75 | === modified file 'loco_directory/events/admin.py' |
76 | --- loco_directory/events/admin.py 2012-12-22 23:22:32 +0000 |
77 | +++ loco_directory/events/admin.py 2012-12-25 22:04:21 +0000 |
78 | @@ -1,6 +1,6 @@ |
79 | # -*- coding: utf-8 -*- |
80 | from django.contrib import admin |
81 | -from .models import * |
82 | +from .models import (Venue, GlobalEvent, TeamEvent, Attendee) |
83 | |
84 | |
85 | class TeamEventAdmin(admin.ModelAdmin): |
86 | |
87 | === modified file 'loco_directory/meetings/admin.py' |
88 | --- loco_directory/meetings/admin.py 2012-12-04 21:25:51 +0000 |
89 | +++ loco_directory/meetings/admin.py 2012-12-25 22:04:21 +0000 |
90 | @@ -1,6 +1,6 @@ |
91 | # -*- coding: utf-8 -*- |
92 | from django.contrib import admin |
93 | -from meetings.models import * |
94 | +from meetings.models import (TeamMeeting, AgendaItem) |
95 | |
96 | admin.site.register(TeamMeeting) |
97 | admin.site.register(AgendaItem) |
98 | |
99 | === modified file 'loco_directory/teams/admin.py' |
100 | --- loco_directory/teams/admin.py 2010-08-24 13:47:33 +0000 |
101 | +++ loco_directory/teams/admin.py 2012-12-25 22:04:21 +0000 |
102 | @@ -3,21 +3,25 @@ |
103 | from django.contrib import admin |
104 | from teams.models import Team, Continent, Country, Language |
105 | |
106 | + |
107 | class TeamAdmin(admin.ModelAdmin): |
108 | search_fields = ('name',) |
109 | - |
110 | + |
111 | def formfield_for_dbfield(self, db_field, **kwargs): |
112 | field = super(TeamAdmin, self).formfield_for_dbfield(db_field, **kwargs) |
113 | if db_field.name == 'description': |
114 | field.widget.attrs['rows'] = '4' |
115 | return field |
116 | - |
117 | + |
118 | + |
119 | class ContinentAdmin(admin.ModelAdmin): |
120 | search_fields = ('name',) |
121 | |
122 | + |
123 | class CountryAdmin(admin.ModelAdmin): |
124 | search_fields = ('name',) |
125 | |
126 | + |
127 | class LanguageAdmin(admin.ModelAdmin): |
128 | search_fields = ('name',) |
129 | |
130 | |
131 | === modified file 'loco_directory/teams/feeds.py' |
132 | --- loco_directory/teams/feeds.py 2012-11-26 23:07:59 +0000 |
133 | +++ loco_directory/teams/feeds.py 2012-12-25 22:04:21 +0000 |
134 | @@ -1,7 +1,6 @@ |
135 | # -*- coding: utf-8 -*- |
136 | from django.core.exceptions import ObjectDoesNotExist |
137 | -from django.core.urlresolvers import reverse |
138 | -from django.contrib.syndication.feeds import Feed, FeedDoesNotExist |
139 | +from django.contrib.syndication.feeds import Feed |
140 | from django.utils.translation import ugettext as _ |
141 | from meetings.models import TeamMeeting |
142 | from events.models import TeamEvent |
143 | @@ -52,5 +51,3 @@ |
144 | return obj.get_absolute_url() |
145 | else: |
146 | return '/' |
147 | - |
148 | - |
149 | |
150 | === modified file 'loco_directory/teams/forms.py' |
151 | --- loco_directory/teams/forms.py 2012-03-04 20:55:07 +0000 |
152 | +++ loco_directory/teams/forms.py 2012-12-25 22:04:21 +0000 |
153 | @@ -1,12 +1,10 @@ |
154 | # -*- coding: utf-8 -*- |
155 | - |
156 | from django import forms |
157 | -from django.utils.translation import ugettext_lazy as _ |
158 | |
159 | from models import Team |
160 | -from userprofiles.models import UserProfile |
161 | from common.forms import RenderableMixin |
162 | |
163 | + |
164 | class UpdateTeamForm(forms.ModelForm, RenderableMixin): |
165 | class Meta: |
166 | model = Team |
167 | @@ -14,12 +12,13 @@ |
168 | |
169 | class Media: |
170 | css = {'all': ( |
171 | - '/media/css/colortip-1.0-jquery.css', |
172 | - )} |
173 | + '/media/css/colortip-1.0-jquery.css', |
174 | + )} |
175 | js = ( |
176 | '/media/js/colortip-1.0-jquery.js', |
177 | ) |
178 | |
179 | + |
180 | class LoCoCouncilForm(UpdateTeamForm, RenderableMixin): |
181 | class Meta(UpdateTeamForm.Meta): |
182 | model = Team |
183 | |
184 | === modified file 'loco_directory/teams/models.py' |
185 | --- loco_directory/teams/models.py 2012-11-18 22:02:56 +0000 |
186 | +++ loco_directory/teams/models.py 2012-12-25 22:04:21 +0000 |
187 | @@ -3,10 +3,10 @@ |
188 | from django.db import models |
189 | from django.utils.translation import ugettext_lazy as _ |
190 | |
191 | -from common.utils import flat_list |
192 | from common.mixins import LocalTimeMixin |
193 | from userprofiles.models import UserProfile |
194 | |
195 | + |
196 | class Language(models.Model): |
197 | class Meta: |
198 | ordering = ('name',) |
199 | @@ -16,9 +16,11 @@ |
200 | def __unicode__(self): |
201 | return u'%s' % (self.name) |
202 | |
203 | + |
204 | class TeamManager(models.Manager): |
205 | pass |
206 | |
207 | + |
208 | class Continent(models.Model): |
209 | name = models.TextField(_("Name"), max_length=50) |
210 | |
211 | @@ -41,6 +43,7 @@ |
212 | def related_teams(self): |
213 | return Team.objects.filter(countries__continents=self).distinct() |
214 | |
215 | + |
216 | class Country(models.Model): |
217 | name = models.TextField(_("Name"), max_length=100) |
218 | continents = models.ManyToManyField(Continent) |
219 | @@ -66,21 +69,25 @@ |
220 | else: |
221 | return 'no_country' |
222 | |
223 | + |
224 | def countries_without_continent(): |
225 | return Country.objects.filter(continents__isnull=True) |
226 | |
227 | + |
228 | def countries_without_continent_have_venues(): |
229 | for country in countries_without_continent(): |
230 | if country.venue_set.count() > 0: |
231 | return True |
232 | return False |
233 | |
234 | + |
235 | def countries_without_continent_have_teams(): |
236 | for country in countries_without_continent(): |
237 | if country.team_set.count() > 0: |
238 | return True |
239 | return False |
240 | |
241 | + |
242 | class Team(models.Model, LocalTimeMixin): |
243 | lp_name = models.CharField(_("Launchpad Team ID"), max_length=40, null=True) |
244 | name = models.CharField(_("Team Name"), max_length=80, null=False, default='') |
245 | @@ -150,5 +157,6 @@ |
246 | events_and_meetings = events_and_meetings[:5] |
247 | return events_and_meetings |
248 | |
249 | + |
250 | def teams_without_country(): |
251 | return Team.objects.filter(countries__isnull=True) |
252 | |
253 | === modified file 'loco_directory/teams/tests.py' |
254 | --- loco_directory/teams/tests.py 2012-11-28 00:46:29 +0000 |
255 | +++ loco_directory/teams/tests.py 2012-12-25 22:04:21 +0000 |
256 | @@ -1,16 +1,12 @@ |
257 | from django.test import TestCase |
258 | +from django.contrib.auth.models import User, Group |
259 | from django.core.urlresolvers import reverse |
260 | from urllib import urlencode |
261 | - |
262 | -from django.contrib.auth.models import User, Group |
263 | - |
264 | from django_openid_auth.models import UserOpenID |
265 | -from userprofiles.models import UserProfile |
266 | from teams.models import * |
267 | from common import launchpad |
268 | |
269 | |
270 | - |
271 | class TestBase(TestCase): |
272 | |
273 | def setUp(self): |
274 | @@ -60,6 +56,7 @@ |
275 | self.user_foo.groups.add(self.team_group) |
276 | self.user_foo.save() |
277 | |
278 | + |
279 | class ACLChecksTestCase(TestBase): |
280 | |
281 | def testAdminIsATeamChecks(self): |
282 | @@ -69,6 +66,7 @@ |
283 | self.assertEquals(launchpad.is_admin_or_owner(self.user_foo.username, team), True) |
284 | self.assertEquals(launchpad.is_admin_or_owner(self.user_bar.username, team), False) |
285 | |
286 | + |
287 | class EditTeamTestCase(TestBase): |
288 | """ |
289 | test if team update works correct |
290 | @@ -79,12 +77,12 @@ |
291 | """ |
292 | #try to access team-update page as not logged in user |
293 | |
294 | - data = { 'next' : '/teams/test-team/edit' } |
295 | - response = self.client.get(reverse( 'team-edit', args=['test-team'] ), follow=True) |
296 | + data = {'next': '/teams/test-team/edit'} |
297 | + response = self.client.get(reverse('team-edit', args=['test-team']), follow=True) |
298 | self.assertRedirects(response, '/openid/login/?%s' % urlencode(data), status_code=302, target_status_code=200) |
299 | |
300 | #try to update team as not logged in user |
301 | - response = self.client.post(reverse('team-edit', args=['test-team']), {'Country':'Germany', 'forum_url':'http://ubuntuusers.de'}, follow=True) |
302 | + response = self.client.post(reverse('team-edit', args=['test-team']), {'Country': 'Germany', 'forum_url': 'http://ubuntuusers.de'}, follow=True) |
303 | self.assertRedirects(response, '/openid/login/?%s' % urlencode(data), status_code=302, target_status_code=200) |
304 | |
305 | def test_user_with_no_rights(self): |
306 | @@ -108,6 +106,7 @@ |
307 | pass |
308 | #FIXME How to use a user with this rights with openid? |
309 | |
310 | + |
311 | class DisplayNameTestCase(TestBase): |
312 | |
313 | def test_override_name(self): |
314 | @@ -135,5 +134,5 @@ |
315 | response = self.client.get('/teams/test-team/') |
316 | self.assertEquals(response.status_code, 200) |
317 | |
318 | - self.assertContains(response, 'Override Name', 0) # No instances of override_name |
319 | - self.assertContains(response, 'Test Team', 4) # One instance of the team name |
320 | + self.assertContains(response, 'Override Name', 0) # No instances of override_name |
321 | + self.assertContains(response, 'Test Team', 4) # One instance of the team name |
322 | |
323 | === modified file 'loco_directory/teams/utils.py' |
324 | --- loco_directory/teams/utils.py 2011-02-17 13:04:25 +0000 |
325 | +++ loco_directory/teams/utils.py 2012-12-25 22:04:21 +0000 |
326 | @@ -2,6 +2,7 @@ |
327 | |
328 | from events.models import TeamEvent |
329 | |
330 | + |
331 | def merge_teams(old_team, new_team): |
332 | msgs = [] |
333 | related_events = TeamEvent.objects.filter(teams__id=old_team.id) |
334 | @@ -60,4 +61,3 @@ |
335 | old_team.delete() |
336 | msgs += [ugettext('Team "%(old_team)s" merged with "%(new_team)s".' % {'old_team':old_team.name, 'new_team':new_team.name})] |
337 | return msgs |
338 | - |
339 | |
340 | === modified file 'loco_directory/teams/views.py' |
341 | --- loco_directory/teams/views.py 2012-12-18 22:35:47 +0000 |
342 | +++ loco_directory/teams/views.py 2012-12-25 22:04:21 +0000 |
343 | @@ -19,10 +19,10 @@ |
344 | from articles.models import Article |
345 | |
346 | import forms |
347 | - |
348 | import datetime |
349 | import vobject |
350 | |
351 | + |
352 | def reapprovals(request): |
353 | teams = filter(lambda a: a.approved and a.expires_date != None, |
354 | Team.objects.all().order_by('expires_date', 'name')) |
355 | @@ -31,11 +31,11 @@ |
356 | # XXX: we have no idea why, but on loco.ubuntu.com we are dealing with |
357 | # datetime.datetime instead of datetime.date - bug 581641 |
358 | if type(teams[0].expires_date) == datetime.datetime: |
359 | - next_teams = filter(lambda a: a.expires_date.date() <= today+half_a_year, teams) |
360 | - later_teams = filter(lambda a: a.expires_date.date() > today+half_a_year, teams) |
361 | + next_teams = filter(lambda a: a.expires_date.date() <= today + half_a_year, teams) |
362 | + later_teams = filter(lambda a: a.expires_date.date() > today + half_a_year, teams) |
363 | else: |
364 | - next_teams = filter(lambda a: a.expires_date <= today+half_a_year, teams) |
365 | - later_teams = filter(lambda a: a.expires_date > today+half_a_year, teams) |
366 | + next_teams = filter(lambda a: a.expires_date <= today + half_a_year, teams) |
367 | + later_teams = filter(lambda a: a.expires_date > today + half_a_year, teams) |
368 | context = { |
369 | 'next_teams': next_teams, |
370 | 'later_teams': later_teams, |
371 | @@ -43,6 +43,7 @@ |
372 | return render_to_response('teams/team_reapprovals.html', |
373 | context, RequestContext(request)) |
374 | |
375 | + |
376 | def as_ical(objects, name): |
377 | """Return any list events as an ical""" |
378 | filename = "%s.ics" % name.replace(' ', '-').lower() |
379 | @@ -61,6 +62,7 @@ |
380 | |
381 | return response |
382 | |
383 | + |
384 | def team_list(request): |
385 | continents = Continent.objects.all().order_by('name') |
386 | for continent in continents: |
387 | @@ -75,17 +77,19 @@ |
388 | 'countries_without_continent': all_countries_without_continent, |
389 | 'countries_without_continent_have_teams': countries_without_continent_have_teams(), |
390 | 'teams_without_country': teams_without_country().order_by('name'), |
391 | - 'colcycle' : simple_iterator('col_left', 'col_right'), |
392 | + 'colcycle': simple_iterator('col_left', 'col_right'), |
393 | } |
394 | return render_to_response('teams/team_list.html', context, |
395 | RequestContext(request)) |
396 | |
397 | + |
398 | def get_events_and_meetings(team_object): |
399 | team_events = list(TeamEvent.objects.filter(teams=team_object)) |
400 | team_meetings = list(TeamMeeting.objects.filter(teams=team_object)) |
401 | team_events.extend(team_meetings) |
402 | return team_events |
403 | |
404 | + |
405 | def team_ical(request, team_slug): |
406 | """ |
407 | Return a ical list with the events and meetings in ical format. |
408 | @@ -93,6 +97,7 @@ |
409 | team_object = get_object_or_404(Team, lp_name=team_slug) |
410 | return as_ical(get_events_and_meetings(team_object), team_object.name) |
411 | |
412 | + |
413 | def team_event_list(request, team_slug): |
414 | """ |
415 | list with all team events in present and future for the given team |
416 | @@ -105,11 +110,12 @@ |
417 | context = { |
418 | 'team_object': team_object, |
419 | 'team_event_list': team_event_list, |
420 | - 'is_member' : is_member, |
421 | + 'is_member': is_member, |
422 | } |
423 | return render_to_response('teams/team_event_list.html', context, |
424 | RequestContext(request)) |
425 | |
426 | + |
427 | def team_event_history(request, team_slug): |
428 | """ |
429 | list with all team events in past for the given team |
430 | @@ -123,6 +129,7 @@ |
431 | return render_to_response('teams/team_event_history.html', context, |
432 | RequestContext(request)) |
433 | |
434 | + |
435 | def team_meeting_list(request, team_slug): |
436 | """ |
437 | list with all team meetings in present and future for the given team |
438 | @@ -136,6 +143,7 @@ |
439 | return render_to_response('teams/team_meeting_list.html', context, |
440 | RequestContext(request)) |
441 | |
442 | + |
443 | def team_meeting_history(request, team_slug): |
444 | """ |
445 | list with all team meetings in past for the given team |
446 | @@ -180,11 +188,12 @@ |
447 | team_list = Team.objects.all().order_by('name') |
448 | other_teams = team_list.exclude(id=team_object.id) |
449 | return render_to_response('teams/select_other_team.html', |
450 | - {'team_object':team_object, |
451 | - 'other_teams':other_teams, |
452 | - 'user':request.user, |
453 | + {'team_object': team_object, |
454 | + 'other_teams': other_teams, |
455 | + 'user': request.user, |
456 | }, RequestContext(request)) |
457 | |
458 | + |
459 | @login_required |
460 | def team_merge(request, team_slug, other_team_slug): |
461 | old_team = get_object_or_404(Team, lp_name=team_slug) |
462 | @@ -202,9 +211,9 @@ |
463 | request.user.message_set.create(message=msg) |
464 | |
465 | return render_to_response('teams/merge_teams.html', |
466 | - {'team_object':old_team, |
467 | - 'other_team_object':new_team, |
468 | - 'user':request.user, |
469 | + {'team_object': old_team, |
470 | + 'other_team_object': new_team, |
471 | + 'user': request.user, |
472 | }, RequestContext(request)) |
473 | |
474 | |
475 | @@ -218,7 +227,7 @@ |
476 | is_contact = launchpad.is_admin_or_owner(request.user.username, team_object) |
477 | if not is_on_lc and not is_contact: |
478 | request.user.message_set.create(message=ugettext('You are not allowed to make changes to the team details.')) |
479 | - return redirect( team_object ) |
480 | + return redirect(team_object) |
481 | |
482 | if request.method == "POST": |
483 | if is_on_lc: |
484 | @@ -228,7 +237,7 @@ |
485 | if form.is_valid(): |
486 | form.save() |
487 | request.user.message_set.create(message=ugettext('Thanks, your team\'s details have been saved.')) |
488 | - return redirect( team_object ) |
489 | + return redirect(team_object) |
490 | else: |
491 | request.user.message_set.create(message=ugettext('Recent changes to your team\'s details could not be saved.')) |
492 | else: |
493 | @@ -239,10 +248,11 @@ |
494 | |
495 | return render_to_response('teams/team_update.html', |
496 | {'form': form, |
497 | - 'team':team_object, |
498 | - 'user':request.user, |
499 | + 'team': team_object, |
500 | + 'user': request.user, |
501 | }, RequestContext(request)) |
502 | |
503 | + |
504 | def xml_team_data(request): |
505 | XMLSerializer = serializers.get_serializer("xml") |
506 | xml_serializer = XMLSerializer() |
507 | |
508 | === modified file 'loco_directory/userprofiles/admin.py' |
509 | --- loco_directory/userprofiles/admin.py 2010-08-24 13:47:33 +0000 |
510 | +++ loco_directory/userprofiles/admin.py 2012-12-25 22:04:21 +0000 |
511 | @@ -1,6 +1,8 @@ |
512 | +# -*- coding: utf-8 -*- |
513 | from django.contrib import admin |
514 | from userprofiles.models import UserProfile |
515 | |
516 | + |
517 | class UserProfileAdmin(admin.ModelAdmin): |
518 | search_fields = ('realname',) |
519 | |
520 | |
521 | === modified file 'loco_directory/userprofiles/management/commands/update-profiles.py' |
522 | --- loco_directory/userprofiles/management/commands/update-profiles.py 2012-11-19 22:53:54 +0000 |
523 | +++ loco_directory/userprofiles/management/commands/update-profiles.py 2012-12-25 22:04:21 +0000 |
524 | @@ -3,13 +3,12 @@ |
525 | |
526 | from django.core.management.base import BaseCommand |
527 | from django.contrib.auth.models import User |
528 | +from optparse import make_option |
529 | |
530 | from userprofiles.models import create_userprofile |
531 | - |
532 | -from optparse import make_option |
533 | -from datetime import datetime |
534 | import sys |
535 | |
536 | + |
537 | class Command(BaseCommand): |
538 | help = "Updates user profiles with information from Launchpad." |
539 | option_list = BaseCommand.option_list + ( |
540 | |
541 | === modified file 'loco_directory/userprofiles/tests.py' |
542 | --- loco_directory/userprofiles/tests.py 2012-11-18 22:02:56 +0000 |
543 | +++ loco_directory/userprofiles/tests.py 2012-12-25 22:04:21 +0000 |
544 | @@ -1,10 +1,11 @@ |
545 | # -*- coding: utf-8 -*- |
546 | from django.test import TestCase |
547 | -from django.contrib.auth.models import User |
548 | +from django.contrib.auth.models import User |
549 | from django.db.models import signals |
550 | |
551 | from userprofiles.models import UserProfile |
552 | |
553 | + |
554 | class SignalTest(TestCase): |
555 | ''' |
556 | Tests that signals fire properly |
557 | @@ -27,4 +28,4 @@ |
558 | def test_profile_creation(self): |
559 | self.user = User.objects.create(username='bob', password='bob') |
560 | self.user.save() |
561 | - self.assertEqual(UserProfile.objects.all().count(), 1) |
562 | \ No newline at end of file |
563 | + self.assertEqual(UserProfile.objects.all().count(), 1) |