Merge lp:~elachuni/ubuntu-webcatalog/nothingness into lp:ubuntu-webcatalog

Proposed by Anthony Lenton
Status: Merged
Approved by: Natalia Bidart
Approved revision: 150
Merged at revision: 150
Proposed branch: lp:~elachuni/ubuntu-webcatalog/nothingness
Merge into: lp:ubuntu-webcatalog
Diff against target: 114 lines (+15/-18)
5 files modified
django_project/urls.py (+0/-2)
src/webcatalog/management/commands/import_all_app_install_data.py (+1/-1)
src/webcatalog/management/commands/import_all_ratings_stats.py (+1/-1)
src/webcatalog/tests/test_commands.py (+7/-7)
src/webcatalog/tests/test_preflight.py (+6/-7)
To merge this branch: bzr merge lp:~elachuni/ubuntu-webcatalog/nothingness
Reviewer Review Type Date Requested Status
Natalia Bidart (community) Approve
Review via email: mp+111486@code.launchpad.net

Commit message

A couple of minor pep8 fixes and test improvements.

Description of the change

This branch originally intended to have any fixes necessary for working with postgresql 9.1, but none were necessary.

So, it just has a couple of minor pep8 fixes, and changes to make a preflight test not hit the wire.

Also the "public url" for preflight was removed, as we don't have the same setup for our production config branch that's not used in the end, and it involved another test that delayed a couple of seconds setting up an openid transaction with staging sso.

To post a comment you must log in.
Revision history for this message
Natalia Bidart (nataliabidart) wrote :

Looks great!

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'django_project/urls.py'
2--- django_project/urls.py 2012-05-30 21:57:52 +0000
3+++ django_project/urls.py 2012-06-21 20:36:21 +0000
4@@ -29,8 +29,6 @@
5 url(r'^cat/', include('webcatalog.urls')),
6 url(r'^admin/', include(admin.site.urls)),
7 (r'^preflight/$', include('preflight.urls')),
8- url(r'^\+preflight/$', redirect_to,
9- {'url': '/openid/login?next=/preflight/'}),
10 url(r'^$', redirect_to, {'url': '/cat/'}),
11
12 # OpenID views
13
14=== modified file 'src/webcatalog/management/commands/import_all_app_install_data.py'
15--- src/webcatalog/management/commands/import_all_app_install_data.py 2012-06-08 14:39:14 +0000
16+++ src/webcatalog/management/commands/import_all_app_install_data.py 2012-06-21 20:36:21 +0000
17@@ -35,7 +35,7 @@
18 def handle_noargs(self, **options):
19 self.verbosity = int(options['verbosity'])
20 for distroseries in settings.UBUNTU_SERIES_FOR_VERSIONS.values():
21- self.output("Importing app-install-data for {0}".format(
22+ self.output("Importing app-install-data for {0}\n".format(
23 distroseries), 1)
24 call_command('import_app_install_data', distroseries)
25
26
27=== modified file 'src/webcatalog/management/commands/import_all_ratings_stats.py'
28--- src/webcatalog/management/commands/import_all_ratings_stats.py 2012-06-08 14:47:54 +0000
29+++ src/webcatalog/management/commands/import_all_ratings_stats.py 2012-06-21 20:36:21 +0000
30@@ -35,7 +35,7 @@
31 def handle_noargs(self, **options):
32 self.verbosity = int(options['verbosity'])
33 for distroseries in settings.UBUNTU_SERIES_FOR_VERSIONS.values():
34- self.output("Importing ratings stats for {0}".format(
35+ self.output("Importing ratings stats for {0}\n".format(
36 distroseries), 1)
37 call_command('import_ratings_stats', distroseries)
38
39
40=== modified file 'src/webcatalog/tests/test_commands.py'
41--- src/webcatalog/tests/test_commands.py 2012-06-20 16:56:53 +0000
42+++ src/webcatalog/tests/test_commands.py 2012-06-21 20:36:21 +0000
43@@ -454,7 +454,7 @@
44 firefox = Application.objects.get(package_name='firefox')
45 self.assertEqual(self.FIREFOX_DESCRIPTION, firefox.description)
46
47- def _make_desktop_file(self, package_name,
48+ def _make_desktop_file(self, package_name,
49 screenshot_url='http://example.com',
50 desktop_file_version="1.0"):
51 desktop_file = tempfile.mktemp()
52@@ -476,14 +476,14 @@
53 """When processing a desktop file, handle if screenshot_url is set."""
54 command = import_app_install_data.Command()
55 desktop_file = self._make_desktop_file(
56- 'foo', screenshot_url='http://foo.com')
57+ 'foo', screenshot_url='http://foo.com')
58
59 distroseries = self.factory.make_distroseries()
60 command.process_desktop_file(desktop_file, '', distroseries)
61 # no breakage!
62
63 def test_process_desktop_file_doesnt_override_version(self):
64- distroseries=self.factory.make_distroseries(code_name='natty')
65+ distroseries = self.factory.make_distroseries(code_name='natty')
66 app = self.factory.make_application(
67 package_name='inkscape', version="1.6.3a123",
68 distroseries=distroseries)
69@@ -1037,8 +1037,8 @@
70
71
72 class ImportAllAppInstallDataTestCase(TestCaseWithFactory):
73-
74- def test_handle(self):
75+ @patch('sys.stdout')
76+ def test_handle(self, mock_stdout):
77 patch_attr = ('webcatalog.management.commands.'
78 'import_all_app_install_data.call_command')
79 with patch_settings(UBUNTU_SERIES_FOR_VERSIONS=TEST_VERSIONS):
80@@ -1049,8 +1049,8 @@
81
82
83 class ImportAllRatingsStatsTestCase(TestCaseWithFactory):
84-
85- def test_handle(self):
86+ @patch('sys.stdout')
87+ def test_handle(self, mock_stdout):
88 patch_attr = ('webcatalog.management.commands.'
89 'import_all_ratings_stats.call_command')
90 with patch_settings(UBUNTU_SERIES_FOR_VERSIONS=TEST_VERSIONS):
91
92=== modified file 'src/webcatalog/tests/test_preflight.py'
93--- src/webcatalog/tests/test_preflight.py 2012-06-06 18:00:26 +0000
94+++ src/webcatalog/tests/test_preflight.py 2012-06-21 20:36:21 +0000
95@@ -40,13 +40,12 @@
96 user.save()
97 self.client.login(username='test', password='test')
98
99- def test_public_url_redirects_to_login(self):
100- response = self.client.get('/+preflight', follow=True)
101-
102- with patch_settings(PREFLIGHT_GROUPS=['preflight']):
103- self.assertContains(response, 'OpenID transaction in progress')
104-
105- def test_login_needed_for_preflight(self):
106+ @patch('webcatalog.utilities.WebServices.identity_provider')
107+ @patch('webcatalog.utilities.WebServices.get_screenshots_for_package')
108+ @patch('webcatalog.utilities.WebServices.recommender_api')
109+ @patch('webcatalog.utilities.WebServices.rnr_api')
110+ def test_login_needed_for_preflight(self, mock_rnr, mock_recommender,
111+ mock_screenshots, mock_sso):
112 self.login()
113
114 with patch_settings(PREFLIGHT_GROUPS=['preflight']):

Subscribers

People subscribed via source and target branches