def test_private_resources_ajax_lookup(self):
        """Test that a private resource isn't present in lookup.

        This AJAX lookup/dropdown is present in the Release Add/Edit form.
        """

        public_project = "Test Project: Resource1"
        private_project = "Test Private Project: Resource1"

        # Test that a private project is not visible to a random user
        self.assertTrue(self.user['registered'] not in self.project_private.maintainers.all())
        resp = self.client['registered'].get('/ajax/ajax_lookup/resources', {'q': 'r', 'limit': '150', })
        self.assertContains(resp, public_project, status_code=200)
        self.assertNotContains(resp, private_project, status_code=200)

        # Test that a private project is visible to its maintainer
        self.assertTrue(self.user['maintainer'] in self.project_private.maintainers.all())
        resp = self.client['maintainer'].get('/ajax/ajax_lookup/resources', {'q': 'r', 'limit': '150', })
        self.assertContains(resp, public_project, status_code=200)
        self.assertContains(resp, private_project, status_code=200)

        # Test that a private project is visible to a member of its teams
        self.assertTrue(self.team_private.members.all() in self.user['team_member'])
        self.assertFalse(self.user['team_member'] in self.project_private.maintainers.all())
        resp = self.client['team_member'].get('/ajax/ajax_lookup/resources', {'q': 'r', 'limit': '150', })
        self.assertContains(resp, public_project, status_code=200)
        self.assertContains(resp, private_project, status_code=200)
dataset/ETHPy150Open rvanlaar/easy-transifex/src/transifex/transifex/resources/tests/views/views.py/ResourcesLookupsTests.test_private_resources_ajax_lookup/swapped operands of `in`