Python rest_framework.test.APITestCase() Examples
The following are 1
code examples of rest_framework.test.APITestCase().
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example.
You may also want to check out all available functions/classes of the module
rest_framework.test
, or try the search function
.
Example #1
Source File: test.py From gro-api with GNU General Public License v2.0 | 6 votes |
def addTest(self, test): if not callable(test): raise TypeError("The test to add must be callable") if (inspect.isclass(test) and issubclass(test, (unittest.TestCase, unittest.TestSuite))): raise TypeError("TestCases and TestSuites must be instantiated " "before passing them to addTest()") if isinstance(test, APITestCase): for layout in test.layouts: if layout is not None: self.configured_tests[layout].append(test) else: self.unconfigured_tests.append(test) else: self.unconfigured_tests.append(test)