Skip to Content
Building RESTful Python Web Services
book

Building RESTful Python Web Services

by Gastón C. Hillar
October 2016
Intermediate to advanced
418 pages
9h 52m
English
Packt Publishing
Content preview from Building RESTful Python Web Services

Improving testing coverage

Now, we will write additional unit tests to improve the testing coverage. Specifically, we will write unit tests related to messages and users. Open the existing api/tests/test_views.py file and insert the following lines after the last line, within the InitialTests class. We need a new import statement and we will declare the new PlayerTests class. The code file for the sample is included in the restful_python_chapter_08_02 folder:

    def create_message(self, message, duration, category): url = url_for('api.messagelistresource', _external=True) data = {'message': message, 'duration': duration, 'category': category} response = self.test_client.post( url, headers=self.get_authentication_headers(self.test_user_name, self.test_user_password), ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Hands-On RESTful Python Web Services - Second Edition

Hands-On RESTful Python Web Services - Second Edition

Gastón C. Hillar

Publisher Resources

ISBN: 9781786462251Supplemental Content