예제 #1
0
def repository_exist(name):
    try:
        Repository.get(Repository.name == name)
    except DoesNotExist:
        return False
    return True
예제 #2
0
 def test_get(self):
     repository = Repository()
     tweet = Tweet("Le gras c'est la vie.")
     repository.add(tweet)
     self.assertEqual(tweet, repository.get(1))
     self.assertIsNone(repository.get(2))