def test_valid_submissions(self):
        success, _ = validate_submission([u"A response."], [{"description": "A prompt."}], STUB_I18N)
        self.assertTrue(success)

        success, _ = validate_submission(
            [u"Response 1.", u"Response 2"], self.PROMPT, STUB_I18N
        )
        self.assertTrue(success)
예제 #2
0
    def test_valid_submissions(self):
        success, msg = validate_submission([u"A response."], [{"description": "A prompt."}], STUB_I18N)
        self.assertTrue(success)

        success, msg = validate_submission(
            [u"Response 1.", u"Response 2"], self.PROMPT, STUB_I18N
        )
        self.assertTrue(success)
    def test_invalid_submissions(self):
        # Submission is not list.
        success, _ = validate_submission(u"A response.", self.PROMPT, STUB_I18N)
        self.assertFalse(success)

        # Submission count does not match prompt count.
        success, _ = validate_submission([u"A response."], self.PROMPT, STUB_I18N)
        self.assertFalse(success)

        # Submission is not unicode.
        success, _ = validate_submission([u"A response.", b"Another response"], self.PROMPT, STUB_I18N)
        self.assertFalse(success)
예제 #4
0
    def test_invalid_submissions(self):
        # Submission is not list.
        success, msg = validate_submission(u"A response.", self.PROMPT, STUB_I18N)
        self.assertFalse(success)

        # Submission count does not match prompt count.
        success, msg = validate_submission([u"A response."], self.PROMPT, STUB_I18N)
        self.assertFalse(success)

        # Submission is not unicode.
        success, msg = validate_submission([u"A response.", "Another response"], self.PROMPT, STUB_I18N)
        self.assertFalse(success)