def test_general_validator_invalid(self): errors = defaultdict(list) dada = copy.deepcopy(TEST_DATA_FLATTENED) dada[('agent', 2, 'URL')] = u'http://www.<asdf123456>' validate_general(('agent', 2, 'URL'), dada, errors, None) assert len(errors) == 1
def test_citation_valid(self): errors = defaultdict(list) dada = copy.deepcopy(TEST_DATA_FLATTENED) dada[('citation',)] = u'T. Tekijä. Test Data. 2000/01/01.' validate_general(('citation',), dada, errors, None) assert len(errors) == 0
def test_citation_invalid(self): errors = defaultdict(list) dada = copy.deepcopy(TEST_DATA_FLATTENED) dada[('citation',)] = u'<invalid>' validate_general(('citation',), dada, errors, None) assert len(errors) == 1
def test_citation_valid(self): errors = defaultdict(list) dada = copy.deepcopy(TEST_DATA_FLATTENED) dada[('citation', )] = u'T. Tekijä. Test Data. 2000/01/01.' validate_general(('citation', ), dada, errors, None) assert len(errors) == 0
def test_citation_invalid(self): errors = defaultdict(list) dada = copy.deepcopy(TEST_DATA_FLATTENED) dada[('citation', )] = u'<invalid>' validate_general(('citation', ), dada, errors, None) assert len(errors) == 1