def setUp(self):
        from letsencrypt.acme.messages import ChallengeRequest
        self.msg = ChallengeRequest(identifier='example.com')

        self.jmsg = {
            'type': 'challengeRequest',
            'identifier': 'example.com',
        }
    def setUp(self):
        from letsencrypt.acme.messages import ChallengeRequest
        self.msg = ChallengeRequest(identifier='example.com')

        self.jmsg = {
            'type': 'challengeRequest',
            'identifier': 'example.com',
        }
class ChallengeRequestTest(unittest.TestCase):
    def setUp(self):
        from letsencrypt.acme.messages import ChallengeRequest
        self.msg = ChallengeRequest(identifier='example.com')

        self.jmsg = {
            'type': 'challengeRequest',
            'identifier': 'example.com',
        }

    def test_to_json(self):
        self.assertEqual(self.msg.to_json(), self.jmsg)

    def test_from_json(self):
        from letsencrypt.acme.messages import ChallengeRequest
        self.assertEqual(ChallengeRequest.from_json(self.jmsg), self.msg)
class ChallengeRequestTest(unittest.TestCase):

    def setUp(self):
        from letsencrypt.acme.messages import ChallengeRequest
        self.msg = ChallengeRequest(identifier='example.com')

        self.jmsg = {
            'type': 'challengeRequest',
            'identifier': 'example.com',
        }

    def test_to_partial_json(self):
        self.assertEqual(self.msg.to_partial_json(), self.jmsg)

    def test_from_json(self):
        from letsencrypt.acme.messages import ChallengeRequest
        self.assertEqual(ChallengeRequest.from_json(self.jmsg), self.msg)
 def test_from_json(self):
     from letsencrypt.acme.messages import ChallengeRequest
     self.assertEqual(ChallengeRequest.from_json(self.jmsg), self.msg)
 def test_from_json(self):
     from letsencrypt.acme.messages import ChallengeRequest
     self.assertEqual(ChallengeRequest.from_json(self.jmsg), self.msg)