def test_mediation_sort_key(self):
    assert (test_module.mediation_sort_key({'state': MediationRecord.STATE_DENIED, 'created_at': ''}) == '2')
    assert (test_module.mediation_sort_key({'state': MediationRecord.STATE_REQUEST, 'created_at': ''}) == '1')
    assert (test_module.mediation_sort_key({'state': MediationRecord.STATE_GRANTED, 'created_at': ''}) == '0')
def test_mediation_sort_key(self):
    assert (test_module.mediation_sort_key({'state': MediationRecord.STATE_DENIED, 'created_at': }) == '2')
    assert (test_module.mediation_sort_key({'state': MediationRecord.STATE_REQUEST, 'created_at': }) == '1')
    assert (test_module.mediation_sort_key({'state': MediationRecord.STATE_GRANTED, 'created_at': }) == '0')