def get_2A_named_test_example(): id = "2A" name = "test example" classification_rows = [["White", "White", "White", 1, True], ["Other", "Other", "Other", 1, True]] return ethnicity_classification_from_data(id=id, name=name, data_rows=classification_rows)
def ethnicity_classification_with_cats_and_dogs_data(): code = "Code1" name = "Cats and Dogs" classification_rows = [["Cat", "Cat", "Cat", 1, True], ["Dog", "Dog", "Dog", 2, True]] return ethnicity_classification_from_data(id=code, name=name, data_rows=classification_rows)
def get_2A(): id = "2A" name = "White and Other" classification_rows = [["White", "White", "White", 1, True], ["Other", "Other", "Other", 1, True]] return ethnicity_classification_from_data(id=id, name=name, data_rows=classification_rows)
def ethnicity_classification_with_required_fish_and_mammal_data(): code = "Code3" name = "Only fish and Mammals" classification_rows = [ ["Mammal", "Mammal", "Mammal", 1, True], ["Fish", "Fish", "Fish", 4, True], ["Cat", "Cat", "Cat", 2, False], ["Dog", "Dog", "Dog", 3, False], ] return ethnicity_classification_from_data(id=code, name=name, data_rows=classification_rows)
def ethnicity_classification_requires_fish_mammal_and_either_reptile_or_other(): code = "Code4" name = "Standard value Reptile may be used in place of Other" classification_rows = [ ["Mammal", "Mammal", "Mammal", 1, True], ["Cat", "Cat", "Mammal", 2, False], ["Dog", "Dog", "Mammal", 3, False], ["Fish", "Fish", "Fish", 4, True], ["Other", "Other", "Other", 5, True], ["Reptile", "Other", "Other", 5, True], ] return ethnicity_classification_from_data(id=code, name=name, data_rows=classification_rows)
def test_classfication_does_initialise_with_simple_values(): # Given # simple classification data code = "example" name = "example" data = [["a", "a", "", 0, True], ["b", "b", "", 1, True]] # When # we build a classification classification = ethnicity_classification_from_data(code, name, data) # Then # an object is returned assert classification is not None
def get_complex_external_classification_without_parents(): id = "5A" name = "Does not have BAME as a parent" classification_rows = [ ["All", "All", "All", 1, False], ["Unknown", "Unknown", "Unknown", 1, False], ["BAME", "BAME", "BAME", 2, False], ["Asian", "Asian", "Asian", 2, True], ["Black", "Black", "Black", 2, True], ["Mixed", "Mixed", "Mixed", 2, True], ["Other", "Other", "Other", 2, True], ["White", "White", "White", 3, True], ] return ethnicity_classification_from_data(id=id, name=name, data_rows=classification_rows)
def get_complex_external_classification_with_parents_and_optionals(): id = "5A+" name = "Has BAME as parents" classification_rows = [ ["All", "All", "All", 1, False], ["Unknown", "Unknown", "Unknown", 1, False], ["BAME", "BAME", "BAME", 2, False], ["Asian", "Asian", "BAME", 2, True], ["Black", "Black", "BAME", 2, True], ["Mixed", "Mixed", "BAME", 2, True], ["Other", "Other", "BAME", 2, True], ["White", "White", "White", 3, True], ] return ethnicity_classification_from_data(id=id, name=name, data_rows=classification_rows)