← Back to team overview

launchpad-reviewers team mailing list archive

Re: [Merge] lp:~thomir/launchpad/devel-add-gpg-noshow-ff into lp:launchpad

 

Review: Approve code



Diff comments:

> 
> === modified file 'lib/lp/registry/browser/tests/test_person.py'
> --- lib/lp/registry/browser/tests/test_person.py	2015-10-13 16:58:20 +0000
> +++ lib/lp/registry/browser/tests/test_person.py	2016-06-13 04:23:43 +0000
> @@ -331,6 +333,43 @@
>              browser = self.getViewBrowser(person)
>          self.assertNotIn(spec.name, browser.contents)
>  
> +    def test_show_gpg_keys_for_view_owner(self):
> +        person = self.factory.makePerson()
> +        with person_logged_in(person):
> +            view = create_initialized_view(person, '+index')
> +            self.assertTrue(view.should_show_gpgkeys_section)
> +
> +    def test_gpg_keys_not_shown_for_user_with_no_gpg_keys(self):
> +        person = self.factory.makePerson()
> +        view = create_initialized_view(person, '+index')
> +        self.assertFalse(view.should_show_gpgkeys_section)
> +
> +    def test_gpg_keys_shown_for_user_with_gpg_keys(self):
> +        person = self.factory.makePerson()
> +        self.factory.makeGPGKey(person)
> +        view = create_initialized_view(person, '+index')
> +        self.assertTrue(view.should_show_gpgkeys_section)
> +
> +    def test_gpg_keys_now_shown_for_owner_with_hide_keys_ff(self):
> +        self.useFixture(FeatureFixture({
> +            GPG_HIDE_PERSON_KEY_LISTING: True,
> +        }))
> +        person = self.factory.makePerson()
> +        with person_logged_in(person):
> +            view = create_initialized_view(person, '+index')
> +            self.assertFalse(view.should_show_gpgkeys_section)
> +
> +    def test_gpg_keys_not_shown_for_user_with_gpg_keys_with_hide_keys_ff(self):
> +        self.useFixture(FeatureFixture({
> +            GPG_HIDE_PERSON_KEY_LISTING: True,
> +        }))
> +        person = self.factory.makePerson()
> +        self.factory.makeGPGKey(person)
> +        view = create_initialized_view(person, '+index')
> +        self.assertFalse(view.should_show_gpgkeys_section)

I'd like to see a test that verifies that the service isn't contacted when the flag is enabled. That will possibly be easier once the client has timeline integration.

> +
> +
> +
>  
>  class TestPersonViewKarma(TestCaseWithFactory):
>  


-- 
https://code.launchpad.net/~thomir/launchpad/devel-add-gpg-noshow-ff/+merge/297146
Your team Launchpad code reviewers is subscribed to branch lp:launchpad.


References