slugbucket / crossword-hints

Python Flask web application to aid decipherment of cryptic crossword clues for known setters
GNU General Public License v3.0
1 stars 0 forks source link

Prepare unit test cases for pagination and search - feat0022 #26

Closed slugbucket closed 4 years ago

slugbucket commented 4 years ago

It should go without saying that test cases should be developed to support the latest features and updates. That hasn't happened with the solution search and pagination features.

slugbucket commented 4 years ago

Since the last set of tests were added, LDAP authentication has been added to the application so it is something that needs to be disabled to enable unit testing to succeed.

slugbucket commented 4 years ago

Removing the traceback output from failed tests requires adding the following global

__unittest = True

Rather than just using assert for the test we can use assertEqual or assertIn with a suitable message to be shown in the error report at the end,

self.assertEqual(nr, self.numx, "Solution deletion failed (expected %s, found %s)" % (self.numx, nr))
slugbucket commented 4 years ago

Removing the traceback output from failed tests requires adding the following global

__unittest = True

Rather than just using assert for the test we can use assertEqual or assertIn with a suitable message to be shown in the error report at the end,

self.assertEqual(nr, self.numx, "Solution deletion failed (expected %s, found %s)" % (self.numx, nr))

Test cases added and merged