Пример #1
0
 def test_no_repeat_bucketlist_names(self):
     """
     Method checks that add bucketlist method does not add bucketlist
     with repeated names
     """
     user = User.query.filter_by(email="*****@*****.**").first()
     bucketlist = BucketList(name='test_bucketlist', user_id=user.id)
     check = bucketlist.add_bucketlist()
     self.assertFalse(check, "Bucketlist should not be added")
     self.assertFalse(
         bucketlist.id,
         "BucketList contains id so has been added to the db"
     )
Пример #2
0
 def test_add_bucketlist(self):
     """
     Method checks that add bucketlist method actually adds a bucketlist
     to the database
     """
     user = User.query.filter_by(email="*****@*****.**").first()
     bucketlist = BucketList(name='test_bucketlist3', user_id=user.id)
     check = bucketlist.add_bucketlist()
     self.assertTrue(check, "Bucketlist should be added")
     self.assertTrue(
         bucketlist.id,
         "BucketList doesnot contain id so has not been added to the db"
     )