def METHOD_NAME(self, ansible_json_encoder, test_input, expected):
    """
    Test for passing datetime.date or datetime.datetime objects to AnsibleJSONEncoder.default().
    """
    assert ansible_json_encoder.default(test_input) == expected