Beispiel #1
0
 def test_get(self, init_db, favorite):
     """Test for get method
     
         Args:
             init_db(SQLAlchemy): fixture to initialize the test database
             favorite (Favorite): Fixture to create a new favorite
     """
     assert Favorite.get(favorite.id) == favorite
Beispiel #2
0
    def test_child_relationships(self, init_db, favorite1):
        """ Test unimplemented child relationships of favorite

            Args:
                init_db(SQLAlchemy): fixture to initialize the test database
                favorite (Favorite): Fixture to create a new favorite
        """

        favorite = Favorite.get(id=favorite1.id)

        with raises(NotImplementedError) as error:
            favorite.get_child_relationships()
        
        assert  str(error.value) == "The get_relationships method must be overridden in all child model classes"