def test_init(self): linked1 = LinkedAccount(primary_user='******', linked_user='******') self.assertIsNotNone(linked1) self.assertEqual("<Linked(id='n/a', primary_user='******', linked_user='******')>", str(linked1)) linked2 = LinkedAccount(id=1, primary_user='******', linked_user='******') self.assertIsNotNone(linked2) self.assertEqual("<Linked(id='1', primary_user='******', linked_user='******')>", str(linked2))
def link_accounts(self, primary_userid, linked_userid): shared = LinkedAccount(primary_user=primary_userid, linked_user=linked_userid) self._storage_engine.session.add(shared) return shared