'Test that the validation method of LibraryContent blocks can warn
the user about problems with other settings (max_count and capa_type).'

def test_validation_of_matching_blocks(self):

    self.lc_block.max_count = 50
    self.lc_block.refresh_children()
    result = self.lc_block.validate()
    self.assertFalse(result)
    self.assertTrue(result.summary)
    self.assertEqual(StudioValidationMessage.WARNING, result.summary.type)
    self.assertIn('only    4    matching    problems', result.summary.text)
    self.lc_block.max_count = 1
    self._create_capa_problems()
    self.lc_block.refresh_children()
    self.assertTrue(self.lc_block.validate())
    self.lc_block.max_count = 1
    self.lc_block.capa_type = 'multiplechoiceresponse'
    self.lc_block.refresh_children()
    self.assertTrue(self.lc_block.validate())
    self.lc_block.max_count = 10
    self.lc_block.capa_type = 'multiplechoiceresponse'
    self.lc_block.refresh_children()
    result = self.lc_block.validate()
    self.assertFalse(result)
    self.assertTrue(result.summary)
    self.assertEqual(StudioValidationMessage.WARNING, result.summary.type)
    self.assertIn('only    1    matching    problem', result.summary.text)
    self.lc_block.max_count = 1
    self.lc_block.capa_type = 'customresponse'
    self.lc_block.refresh_children()
    result = self.lc_block.validate()
    self.assertFalse(result)
    self.assertTrue(result.summary)
    self.assertEqual(StudioValidationMessage.WARNING, result.summary.type)
    self.assertIn('no    matching    problem    types', result.summary.text)
