Merge lp:~canonical-ca-hackers/ubuntu-webcatalog/965473-none-in-the-url into lp:ubuntu-webcatalog

Proposed by Łukasz Czyżykowski
Status: Merged
Approved by: Michael Nelson
Approved revision: 98
Merged at revision: 94
Proposed branch: lp:~canonical-ca-hackers/ubuntu-webcatalog/965473-none-in-the-url
Merge into: lp:ubuntu-webcatalog
Diff against target: 34 lines (+12/-1)
2 files modified
src/webcatalog/tests/test_views.py (+11/-0)
src/webcatalog/views.py (+1/-1)
To merge this branch: bzr merge lp:~canonical-ca-hackers/ubuntu-webcatalog/965473-none-in-the-url
Reviewer Review Type Date Requested Status
Michael Nelson (community) Approve
Review via email: mp+100099@code.launchpad.net

Commit message

Fixed Bug:965473

Description of the change

Overview
========
Fixed Bug:965473. Additionally made the url which is sent to the Twitter always stay the same, regardless of the distroseries selected.

To post a comment you must log in.
Revision history for this message
Michael Nelson (michael.nelson) wrote :

13:28 < noodles> lukasz: could thee test on linee 14 do self.assertContains(response, 'href="/cat/applications/whatever') instead of assertNotContains?
13:33 < lukasz> noodles, sure, but why?
13:34 < noodles> lukasz: because asserting that something isn't contained in the result can lead to very easy false positives (ie. the link is moved to a different template)

Thanks for the updated test!

review: Approve
Revision history for this message
ISD Branch Mangler (isd-branches-mangler) wrote :

There are additional revisions which have not been approved in review. Please seek review and approval of these new revisions.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/webcatalog/tests/test_views.py'
2--- src/webcatalog/tests/test_views.py 2012-03-28 12:45:14 +0000
3+++ src/webcatalog/tests/test_views.py 2012-03-30 13:50:24 +0000
4@@ -169,6 +169,17 @@
5 self.assertContains(response, "Tweet</a>")
6 self.assertContains(response, "https://twitter.com/share")
7
8+ def test_twitter_link_does_not_contain_none(self):
9+ app = self.factory.make_application()
10+
11+ response = self.client.get(
12+ reverse('wc-package-detail', args=[app.package_name]))
13+
14+ self.assertContains(
15+ response,
16+ 'data-url="http://testserver/cat/applications/{0}/"'.format(
17+ app.package_name))
18+
19 def test_google_plus_button_is_present(self):
20 response, app = self.get_app_and_response()
21
22
23=== modified file 'src/webcatalog/views.py'
24--- src/webcatalog/views.py 2012-03-23 22:42:24 +0000
25+++ src/webcatalog/views.py 2012-03-30 13:50:24 +0000
26@@ -184,7 +184,7 @@
27 'breadcrumbs': app.crumbs(),
28 'distroseries': distro,
29 'absolute_url': request.build_absolute_uri(
30- reverse('wc-package-detail', args=[distro, package_name])),
31+ reverse('wc-package-detail', args=[package_name])),
32 'email_form': form,
33 'debtags': debtags,
34 }

Subscribers

People subscribed via source and target branches