コード例 #1
0
    def setUp(self):
        """
        Adds required temporary setting for the test.
        """
        # Setup the mock
        response = StringIO('issue:\n    number: 123')
        urllib = Mock('urllib', tracker=None)
        urllib.urlopen = Mock('urllib.urlopen', returns=response, tracker=None)

        settings.ERROR_CAPTURE_GITHUB_REPO = 'fake_repo'
        settings.ERROR_CAPTURE_GITHUB_TOKEN = 'fake_token'
        settings.ERROR_CAPTURE_GITHUB_LOGIN = '******'
        super(GitHubHandlerTestCase, self).setUp()
        self.instance.urllib = urllib