Here are the examples of the python api myapp.models.Author taken from open source projects. By voting up you can indicate which examples are most useful and appropriate.
3 Examples
3
Example 1
Project: Flask-Fixtures
License: View license
Source File: test_fixtures.py
Function: test_add_author
License: View license
Source File: test_fixtures.py
Function: test_add_author
def test_add_author(self):
# Add another author on the fly
author = Author()
author.first_name = 'George'
author.last_name = 'Orwell'
self.db.session.add(author)
self.db.session.commit()
3
Example 2
def test_one(self):
print("Inside test_one")
# Add another author on the fly
author = Author()
author.first_name = 'George'
author.last_name = 'Orwell'
self.db.session.add(author)
# Add another book for the new author
book = Book()
book.title = "1984"
book.published_date = datetime.datetime(1949, 6, 8)
self.db.session.add(book)
self.db.session.commit()
3
Example 3
def test_two(self):
print("Inside test_two")
# Add another author on the fly
author = Author()
author.first_name = 'Aldous'
author.last_name = 'Huxley'
self.db.session.add(author)
# Add another book for the new author
book = Book()
book.title = "Brave New World"
book.published_date = datetime.datetime(1932, 5, 12)
self.db.session.add(book)
self.db.session.commit()