def METHOD_NAME(cls, server_url, association):
    assoc = TestAssociation.cache.get((server_url, association.handle))
    if assoc is None:
        assoc = TestAssociation(server_url=server_url, handle=association.handle)
    assoc.secret = base64.encodebytes(association.secret)
    assoc.issued = association.issued
    assoc.lifetime = association.lifetime
    assoc.assoc_type = association.assoc_type
    assoc.save()