'Ensure that the answer will not be shown when correctness is being hidden.'

@ddt.data(({'showanswer': 'attempted', 'max_attempts': '1', 'show_correctness': 'always'}, True), ({'showanswer': 'attempted', 'max_attempts': '1', 'show_correctness': 'never'}, False), ({'showanswer': 'attempted', 'show_correctness': 'past_due', 'max_attempts': '1', 'due': 'tomorrow_str'}, False), ({'showanswer': 'attempted', 'show_correctness': 'past_due', 'max_attempts': '1', 'due': 'yesterday_str'}, True))
@ddt.unpack
def test_showanswer_hide_correctness(self, problem_data, answer_available):

    if ('due' in problem_data):
        problem_data['due'] = getattr(self, problem_data['due'])
    problem = CapaFactory.create(**problem_data)
    self.assertFalse(problem.answer_available())
    problem.attempts = 1
    self.assertEqual(problem.answer_available(), answer_available)
