| | |
- django.test.testcases.TestCase(django.test.testcases.TransactionTestCase)
-
- AutoCompleteTest
- SearchFormTest
- ViewTest
class AutoCompleteTest(django.test.testcases.TestCase) |
| |
Tests for autocomplete. |
| |
- Method resolution order:
- AutoCompleteTest
- django.test.testcases.TestCase
- django.test.testcases.TransactionTestCase
- django.test.testcases.SimpleTestCase
- unittest.case.TestCase
- builtins.object
Methods defined here:
- test_actor_autocompletion(self)
- Tests autocompletion for actor. Check that we grab data from all three actors fields
- test_director_autocompletion(self)
- Tests autocompletion for director.
- test_distributor_autocompletion(self)
- Tests autocompletion for distributor.
- test_distributor_autocompletion_empty_result(self)
- Tests autocompletion for distributor.
- test_production_company_autocompletion(self)
- Tests autocompletion for production_company.
- test_title_autocompletion(self)
- Tests autocompletion for title.
- test_title_autocompletion_with_empty_result(self)
- Tests autocompletion for title.
- test_writer_autocompletion(self)
- Tests autocompletion for writer.
Class methods defined here:
- setUpClass() from builtins.type
- # Django 1.7 requires an explicit setup() when running tests in PTVS
Methods inherited from django.test.testcases.TransactionTestCase:
- assertNumQueries(self, num, func=None, *args, **kwargs)
- assertQuerysetEqual(self, qs, values, transform=, ordered=True, msg=None)
Data and other attributes inherited from django.test.testcases.TransactionTestCase:
- available_apps = None
- fixtures = None
- reset_sequences = False
- serialized_rollback = False
Methods inherited from django.test.testcases.SimpleTestCase:
- __call__(self, result=None)
- Wrapper around default __call__ method to perform common Django test
set up. This means that user-defined Test Cases aren't required to
include a call to super().setUp().
- assertContains(self, response, text, count=None, status_code=200, msg_prefix='', html=False)
- Asserts that a response indicates that some content was retrieved
successfully, (i.e., the HTTP status code was as expected), and that
``text`` occurs ``count`` times in the content of the response.
If ``count`` is None, the count doesn't matter - the assertion is true
if the text occurs at least once in the response.
- assertFieldOutput(self, fieldclass, valid, invalid, field_args=None, field_kwargs=None, empty_value='')
- Asserts that a form field behaves correctly with various inputs.
Args:
fieldclass: the class of the field to be tested.
valid: a dictionary mapping valid inputs to their expected
cleaned values.
invalid: a dictionary mapping invalid inputs to one or more
raised error messages.
field_args: the args passed to instantiate the field
field_kwargs: the kwargs passed to instantiate the field
empty_value: the expected clean output for inputs in empty_values
- assertFormError(self, response, form, field, errors, msg_prefix='')
- Asserts that a form used to render the response has a specific field
error.
- assertFormsetError(self, response, formset, form_index, field, errors, msg_prefix='')
- Asserts that a formset used to render the response has a specific error.
For field errors, specify the ``form_index`` and the ``field``.
For non-field errors, specify the ``form_index`` and the ``field`` as
None.
For non-form errors, specify ``form_index`` as None and the ``field``
as None.
- assertHTMLEqual(self, html1, html2, msg=None)
- Asserts that two HTML snippets are semantically the same.
Whitespace in most cases is ignored, and attribute ordering is not
significant. The passed-in arguments must be valid HTML.
- assertHTMLNotEqual(self, html1, html2, msg=None)
- Asserts that two HTML snippets are not semantically equivalent.
- assertInHTML(self, needle, haystack, count=None, msg_prefix='')
- assertJSONEqual(self, raw, expected_data, msg=None)
- assertNotContains(self, response, text, status_code=200, msg_prefix='', html=False)
- Asserts that a response indicates that some content was retrieved
successfully, (i.e., the HTTP status code was as expected), and that
``text`` doesn't occurs in the content of the response.
- assertRaisesMessage(self, expected_exception, expected_message, callable_obj=None, *args, **kwargs)
- Asserts that the message in a raised exception matches the passed
value.
Args:
expected_exception: Exception class expected to be raised.
expected_message: expected error message string value.
callable_obj: Function to be called.
args: Extra args.
kwargs: Extra kwargs.
- assertRedirects(self, response, expected_url, status_code=302, target_status_code=200, host=None, msg_prefix='', fetch_redirect_response=True)
- Asserts that a response redirected to a specific URL, and that the
redirect URL can be loaded.
Note that assertRedirects won't work for external links since it uses
TestClient to do a request (use fetch_redirect_response=False to check
such links without fetching them).
- assertTemplateNotUsed(self, response=None, template_name=None, msg_prefix='')
- Asserts that the template with the provided name was NOT used in
rendering the response. Also usable as context manager.
- assertTemplateUsed(self, response=None, template_name=None, msg_prefix='')
- Asserts that the template with the provided name was used in rendering
the response. Also usable as context manager.
- assertXMLEqual(self, xml1, xml2, msg=None)
- Asserts that two XML snippets are semantically the same.
Whitespace in most cases is ignored, and attribute ordering is not
significant. The passed-in arguments must be valid XML.
- assertXMLNotEqual(self, xml1, xml2, msg=None)
- Asserts that two XML snippets are not semantically equivalent.
Whitespace in most cases is ignored, and attribute ordering is not
significant. The passed-in arguments must be valid XML.
- modify_settings(self, **kwargs)
- A context manager that temporarily applies changes a list setting and
reverts back to the original value when exiting the context.
- settings(self, **kwargs)
- A context manager that temporarily sets a setting and reverts to the original value when exiting the context.
Data and other attributes inherited from django.test.testcases.SimpleTestCase:
- client_class = <class 'django.test.client.Client'>
- A class that can act as a client for testing purposes.
It allows the user to compose GET and POST requests, and
obtain the response that the server gave to those requests.
The server Response objects are annotated with the details
of the contexts and templates that were rendered during the
process of serving the request.
Client objects are stateful - they will retain cookie (and
thus session) details for the lifetime of the Client instance.
This is not intended as a replacement for Twill/Selenium or
the like - it is here to allow testing against the
contexts and templates produced by a view, rather than the
HTML rendered to the end-user.
Methods inherited from unittest.case.TestCase:
- __eq__(self, other)
- __hash__(self)
- __init__(self, methodName='runTest')
- Create an instance of the class that will use the named test
method when executed. Raises a ValueError if the instance does
not have a method with the specified name.
- __repr__(self)
- __str__(self)
- addCleanup(self, function, *args, **kwargs)
- Add a function, with arguments, to be called when the test is
completed. Functions added are called on a LIFO basis and are
called after tearDown on test failure or success.
Cleanup items are called even if setUp fails (unlike tearDown).
- addTypeEqualityFunc(self, typeobj, function)
- Add a type specific assertEqual style function to compare a type.
This method is for use by TestCase subclasses that need to register
their own type equality functions to provide nicer error messages.
Args:
typeobj: The data type to call this function on when both values
are of the same type in assertEqual().
function: The callable taking two arguments and an optional
msg= argument that raises self.failureException with a
useful error message when the two arguments are not equal.
- assertAlmostEqual(self, first, second, places=None, msg=None, delta=None)
- Fail if the two objects are unequal as determined by their
difference rounded to the given number of decimal places
(default 7) and comparing to zero, or by comparing that the
between the two objects is more than the given delta.
Note that decimal places (from zero) are usually not the same
as significant digits (measured from the most signficant digit).
If the two objects compare equal then they will automatically
compare almost equal.
- assertAlmostEquals = deprecated_func(*args, **kwargs)
- assertCountEqual(self, first, second, msg=None)
- An unordered sequence comparison asserting that the same elements,
regardless of order. If the same element occurs more than once,
it verifies that the elements occur the same number of times.
self.assertEqual(Counter(list(first)),
Counter(list(second)))
Example:
- [0, 1, 1] and [1, 0, 1] compare equal.
- [0, 0, 1] and [0, 1] compare unequal.
- assertDictContainsSubset(self, subset, dictionary, msg=None)
- Checks whether dictionary is a superset of subset.
- assertDictEqual(self, d1, d2, msg=None)
- assertEqual(self, first, second, msg=None)
- Fail if the two objects are unequal as determined by the '=='
operator.
- assertEquals = deprecated_func(*args, **kwargs)
- assertFalse(self, expr, msg=None)
- Check that the expression is false.
- assertGreater(self, a, b, msg=None)
- Just like self.assertTrue(a > b), but with a nicer default message.
- assertGreaterEqual(self, a, b, msg=None)
- Just like self.assertTrue(a >= b), but with a nicer default message.
- assertIn(self, member, container, msg=None)
- Just like self.assertTrue(a in b), but with a nicer default message.
- assertIs(self, expr1, expr2, msg=None)
- Just like self.assertTrue(a is b), but with a nicer default message.
- assertIsInstance(self, obj, cls, msg=None)
- Same as self.assertTrue(isinstance(obj, cls)), with a nicer
default message.
- assertIsNone(self, obj, msg=None)
- Same as self.assertTrue(obj is None), with a nicer default message.
- assertIsNot(self, expr1, expr2, msg=None)
- Just like self.assertTrue(a is not b), but with a nicer default message.
- assertIsNotNone(self, obj, msg=None)
- Included for symmetry with assertIsNone.
- assertLess(self, a, b, msg=None)
- Just like self.assertTrue(a < b), but with a nicer default message.
- assertLessEqual(self, a, b, msg=None)
- Just like self.assertTrue(a <= b), but with a nicer default message.
- assertListEqual(self, list1, list2, msg=None)
- A list-specific equality assertion.
Args:
list1: The first list to compare.
list2: The second list to compare.
msg: Optional message to use on failure instead of a list of
differences.
- assertLogs(self, logger=None, level=None)
- Fail unless a log message of level *level* or higher is emitted
on *logger_name* or its children. If omitted, *level* defaults to
INFO and *logger* defaults to the root logger.
This method must be used as a context manager, and will yield
a recording object with two attributes: `output` and `records`.
At the end of the context manager, the `output` attribute will
be a list of the matching formatted log messages and the
`records` attribute will be a list of the corresponding LogRecord
objects.
Example::
with self.assertLogs('foo', level='INFO') as cm:
logging.getLogger('foo').info('first message')
logging.getLogger('foo.bar').error('second message')
self.assertEqual(cm.output, ['INFO:foo:first message',
'ERROR:foo.bar:second message'])
- assertMultiLineEqual(self, first, second, msg=None)
- Assert that two multi-line strings are equal.
- assertNotAlmostEqual(self, first, second, places=None, msg=None, delta=None)
- Fail if the two objects are equal as determined by their
difference rounded to the given number of decimal places
(default 7) and comparing to zero, or by comparing that the
between the two objects is less than the given delta.
Note that decimal places (from zero) are usually not the same
as significant digits (measured from the most signficant digit).
Objects that are equal automatically fail.
- assertNotAlmostEquals = deprecated_func(*args, **kwargs)
- assertNotEqual(self, first, second, msg=None)
- Fail if the two objects are equal as determined by the '!='
operator.
- assertNotEquals = deprecated_func(*args, **kwargs)
- assertNotIn(self, member, container, msg=None)
- Just like self.assertTrue(a not in b), but with a nicer default message.
- assertNotIsInstance(self, obj, cls, msg=None)
- Included for symmetry with assertIsInstance.
- assertNotRegex(self, text, unexpected_regex, msg=None)
- Fail the test if the text matches the regular expression.
- assertRaises(self, excClass, callableObj=None, *args, **kwargs)
- Fail unless an exception of class excClass is raised
by callableObj when invoked with arguments args and keyword
arguments kwargs. If a different type of exception is
raised, it will not be caught, and the test case will be
deemed to have suffered an error, exactly as for an
unexpected exception.
If called with callableObj omitted or None, will return a
context object used like this::
with self.assertRaises(SomeException):
do_something()
An optional keyword argument 'msg' can be provided when assertRaises
is used as a context object.
The context manager keeps a reference to the exception as
the 'exception' attribute. This allows you to inspect the
exception after the assertion::
with self.assertRaises(SomeException) as cm:
do_something()
the_exception = cm.exception
self.assertEqual(the_exception.error_code, 3)
- assertRaisesRegex(self, expected_exception, expected_regex, callable_obj=None, *args, **kwargs)
- Asserts that the message in a raised exception matches a regex.
Args:
expected_exception: Exception class expected to be raised.
expected_regex: Regex (re pattern object or string) expected
to be found in error message.
callable_obj: Function to be called.
msg: Optional message used in case of failure. Can only be used
when assertRaisesRegex is used as a context manager.
args: Extra args.
kwargs: Extra kwargs.
- assertRaisesRegexp = deprecated_func(*args, **kwargs)
- assertRegex(self, text, expected_regex, msg=None)
- Fail the test unless the text matches the regular expression.
- assertRegexpMatches = deprecated_func(*args, **kwargs)
- assertSequenceEqual(self, seq1, seq2, msg=None, seq_type=None)
- An equality assertion for ordered sequences (like lists and tuples).
For the purposes of this function, a valid ordered sequence type is one
which can be indexed, has a length, and has an equality operator.
Args:
seq1: The first sequence to compare.
seq2: The second sequence to compare.
seq_type: The expected datatype of the sequences, or None if no
datatype should be enforced.
msg: Optional message to use on failure instead of a list of
differences.
- assertSetEqual(self, set1, set2, msg=None)
- A set-specific equality assertion.
Args:
set1: The first set to compare.
set2: The second set to compare.
msg: Optional message to use on failure instead of a list of
differences.
assertSetEqual uses ducktyping to support different types of sets, and
is optimized for sets specifically (parameters must support a
difference method).
- assertTrue(self, expr, msg=None)
- Check that the expression is true.
- assertTupleEqual(self, tuple1, tuple2, msg=None)
- A tuple-specific equality assertion.
Args:
tuple1: The first tuple to compare.
tuple2: The second tuple to compare.
msg: Optional message to use on failure instead of a list of
differences.
- assertWarns(self, expected_warning, callable_obj=None, *args, **kwargs)
- Fail unless a warning of class warnClass is triggered
by callable_obj when invoked with arguments args and keyword
arguments kwargs. If a different type of warning is
triggered, it will not be handled: depending on the other
warning filtering rules in effect, it might be silenced, printed
out, or raised as an exception.
If called with callable_obj omitted or None, will return a
context object used like this::
with self.assertWarns(SomeWarning):
do_something()
An optional keyword argument 'msg' can be provided when assertWarns
is used as a context object.
The context manager keeps a reference to the first matching
warning as the 'warning' attribute; similarly, the 'filename'
and 'lineno' attributes give you information about the line
of Python code from which the warning was triggered.
This allows you to inspect the warning after the assertion::
with self.assertWarns(SomeWarning) as cm:
do_something()
the_warning = cm.warning
self.assertEqual(the_warning.some_attribute, 147)
- assertWarnsRegex(self, expected_warning, expected_regex, callable_obj=None, *args, **kwargs)
- Asserts that the message in a triggered warning matches a regexp.
Basic functioning is similar to assertWarns() with the addition
that only warnings whose messages also match the regular expression
are considered successful matches.
Args:
expected_warning: Warning class expected to be triggered.
expected_regex: Regex (re pattern object or string) expected
to be found in error message.
callable_obj: Function to be called.
msg: Optional message used in case of failure. Can only be used
when assertWarnsRegex is used as a context manager.
args: Extra args.
kwargs: Extra kwargs.
- assert_ = deprecated_func(*args, **kwargs)
- countTestCases(self)
- debug(self)
- Run the test without collecting errors in a TestResult
- defaultTestResult(self)
- doCleanups(self)
- Execute all cleanup functions. Normally called for you after
tearDown.
- fail(self, msg=None)
- Fail immediately, with the given message.
- failIf = deprecated_func(*args, **kwargs)
- failIfAlmostEqual = deprecated_func(*args, **kwargs)
- failIfEqual = deprecated_func(*args, **kwargs)
- failUnless = deprecated_func(*args, **kwargs)
- failUnlessAlmostEqual = deprecated_func(*args, **kwargs)
- failUnlessEqual = deprecated_func(*args, **kwargs)
- failUnlessRaises = deprecated_func(*args, **kwargs)
- id(self)
- run(self, result=None)
- setUp(self)
- Hook method for setting up the test fixture before exercising it.
- shortDescription(self)
- Returns a one-line description of the test, or None if no
description has been provided.
The default implementation of this method returns the first line of
the specified test method's docstring.
- skipTest(self, reason)
- Skip this test.
- subTest(self, msg=None, **params)
- Return a context manager that will return the enclosed block
of code in a subtest identified by the optional message and
keyword parameters. A failure in the subtest marks the test
case as failed but resumes execution at the end of the enclosed
block, allowing further test code to be executed.
- tearDown(self)
- Hook method for deconstructing the test fixture after testing it.
Class methods inherited from unittest.case.TestCase:
- tearDownClass() from builtins.type
- Hook method for deconstructing the class fixture after running all tests in the class.
Data descriptors inherited from unittest.case.TestCase:
- __dict__
- dictionary for instance variables (if defined)
- __weakref__
- list of weak references to the object (if defined)
Data and other attributes inherited from unittest.case.TestCase:
- failureException = <class 'AssertionError'>
- Assertion failed.
- longMessage = True
- maxDiff = 640
|
class SearchFormTest(django.test.testcases.TestCase) |
| |
Tests for the search.
All magic numbers are calculated as N = (number of search result) * 2 (+ 1). +1 only in search by title.
As titles appear twice on marker and one comes from search form, if we search by title |
| |
- Method resolution order:
- SearchFormTest
- django.test.testcases.TestCase
- django.test.testcases.TransactionTestCase
- django.test.testcases.SimpleTestCase
- unittest.case.TestCase
- builtins.object
Methods defined here:
- test_search_by_actor_1_and_2(self)
- Tests search by actor specified in actor_3 field.
- test_search_by_actor_2(self)
- Tests search by actor specified in actor_3 field.
- test_search_by_actor_3(self)
- Tests search by actor specified in actor_3 field.
- test_search_by_address(self)
- Tests search by title.
- test_search_by_address_without_distance(self)
- Tests search by title.
- test_search_by_title(self)
- Tests search by title.
- test_search_by_year(self)
- Tests search by title.
- test_search_misformed_post(self)
- Tests search with empty POST request
Class methods defined here:
- setUpClass() from builtins.type
- # Django 1.7 requires an explicit setup() when running tests in PTVS
Data and other attributes defined here:
- EMPTY_SEARCH_QUERY = {'actor': '', 'director': '', 'distance': '', 'distributor': '', 'production_company': '', 'query': '', 'title': '', 'writer': '', 'year': ''}
Methods inherited from django.test.testcases.TransactionTestCase:
- assertNumQueries(self, num, func=None, *args, **kwargs)
- assertQuerysetEqual(self, qs, values, transform=, ordered=True, msg=None)
Data and other attributes inherited from django.test.testcases.TransactionTestCase:
- available_apps = None
- fixtures = None
- reset_sequences = False
- serialized_rollback = False
Methods inherited from django.test.testcases.SimpleTestCase:
- __call__(self, result=None)
- Wrapper around default __call__ method to perform common Django test
set up. This means that user-defined Test Cases aren't required to
include a call to super().setUp().
- assertContains(self, response, text, count=None, status_code=200, msg_prefix='', html=False)
- Asserts that a response indicates that some content was retrieved
successfully, (i.e., the HTTP status code was as expected), and that
``text`` occurs ``count`` times in the content of the response.
If ``count`` is None, the count doesn't matter - the assertion is true
if the text occurs at least once in the response.
- assertFieldOutput(self, fieldclass, valid, invalid, field_args=None, field_kwargs=None, empty_value='')
- Asserts that a form field behaves correctly with various inputs.
Args:
fieldclass: the class of the field to be tested.
valid: a dictionary mapping valid inputs to their expected
cleaned values.
invalid: a dictionary mapping invalid inputs to one or more
raised error messages.
field_args: the args passed to instantiate the field
field_kwargs: the kwargs passed to instantiate the field
empty_value: the expected clean output for inputs in empty_values
- assertFormError(self, response, form, field, errors, msg_prefix='')
- Asserts that a form used to render the response has a specific field
error.
- assertFormsetError(self, response, formset, form_index, field, errors, msg_prefix='')
- Asserts that a formset used to render the response has a specific error.
For field errors, specify the ``form_index`` and the ``field``.
For non-field errors, specify the ``form_index`` and the ``field`` as
None.
For non-form errors, specify ``form_index`` as None and the ``field``
as None.
- assertHTMLEqual(self, html1, html2, msg=None)
- Asserts that two HTML snippets are semantically the same.
Whitespace in most cases is ignored, and attribute ordering is not
significant. The passed-in arguments must be valid HTML.
- assertHTMLNotEqual(self, html1, html2, msg=None)
- Asserts that two HTML snippets are not semantically equivalent.
- assertInHTML(self, needle, haystack, count=None, msg_prefix='')
- assertJSONEqual(self, raw, expected_data, msg=None)
- assertNotContains(self, response, text, status_code=200, msg_prefix='', html=False)
- Asserts that a response indicates that some content was retrieved
successfully, (i.e., the HTTP status code was as expected), and that
``text`` doesn't occurs in the content of the response.
- assertRaisesMessage(self, expected_exception, expected_message, callable_obj=None, *args, **kwargs)
- Asserts that the message in a raised exception matches the passed
value.
Args:
expected_exception: Exception class expected to be raised.
expected_message: expected error message string value.
callable_obj: Function to be called.
args: Extra args.
kwargs: Extra kwargs.
- assertRedirects(self, response, expected_url, status_code=302, target_status_code=200, host=None, msg_prefix='', fetch_redirect_response=True)
- Asserts that a response redirected to a specific URL, and that the
redirect URL can be loaded.
Note that assertRedirects won't work for external links since it uses
TestClient to do a request (use fetch_redirect_response=False to check
such links without fetching them).
- assertTemplateNotUsed(self, response=None, template_name=None, msg_prefix='')
- Asserts that the template with the provided name was NOT used in
rendering the response. Also usable as context manager.
- assertTemplateUsed(self, response=None, template_name=None, msg_prefix='')
- Asserts that the template with the provided name was used in rendering
the response. Also usable as context manager.
- assertXMLEqual(self, xml1, xml2, msg=None)
- Asserts that two XML snippets are semantically the same.
Whitespace in most cases is ignored, and attribute ordering is not
significant. The passed-in arguments must be valid XML.
- assertXMLNotEqual(self, xml1, xml2, msg=None)
- Asserts that two XML snippets are not semantically equivalent.
Whitespace in most cases is ignored, and attribute ordering is not
significant. The passed-in arguments must be valid XML.
- modify_settings(self, **kwargs)
- A context manager that temporarily applies changes a list setting and
reverts back to the original value when exiting the context.
- settings(self, **kwargs)
- A context manager that temporarily sets a setting and reverts to the original value when exiting the context.
Data and other attributes inherited from django.test.testcases.SimpleTestCase:
- client_class = <class 'django.test.client.Client'>
- A class that can act as a client for testing purposes.
It allows the user to compose GET and POST requests, and
obtain the response that the server gave to those requests.
The server Response objects are annotated with the details
of the contexts and templates that were rendered during the
process of serving the request.
Client objects are stateful - they will retain cookie (and
thus session) details for the lifetime of the Client instance.
This is not intended as a replacement for Twill/Selenium or
the like - it is here to allow testing against the
contexts and templates produced by a view, rather than the
HTML rendered to the end-user.
Methods inherited from unittest.case.TestCase:
- __eq__(self, other)
- __hash__(self)
- __init__(self, methodName='runTest')
- Create an instance of the class that will use the named test
method when executed. Raises a ValueError if the instance does
not have a method with the specified name.
- __repr__(self)
- __str__(self)
- addCleanup(self, function, *args, **kwargs)
- Add a function, with arguments, to be called when the test is
completed. Functions added are called on a LIFO basis and are
called after tearDown on test failure or success.
Cleanup items are called even if setUp fails (unlike tearDown).
- addTypeEqualityFunc(self, typeobj, function)
- Add a type specific assertEqual style function to compare a type.
This method is for use by TestCase subclasses that need to register
their own type equality functions to provide nicer error messages.
Args:
typeobj: The data type to call this function on when both values
are of the same type in assertEqual().
function: The callable taking two arguments and an optional
msg= argument that raises self.failureException with a
useful error message when the two arguments are not equal.
- assertAlmostEqual(self, first, second, places=None, msg=None, delta=None)
- Fail if the two objects are unequal as determined by their
difference rounded to the given number of decimal places
(default 7) and comparing to zero, or by comparing that the
between the two objects is more than the given delta.
Note that decimal places (from zero) are usually not the same
as significant digits (measured from the most signficant digit).
If the two objects compare equal then they will automatically
compare almost equal.
- assertAlmostEquals = deprecated_func(*args, **kwargs)
- assertCountEqual(self, first, second, msg=None)
- An unordered sequence comparison asserting that the same elements,
regardless of order. If the same element occurs more than once,
it verifies that the elements occur the same number of times.
self.assertEqual(Counter(list(first)),
Counter(list(second)))
Example:
- [0, 1, 1] and [1, 0, 1] compare equal.
- [0, 0, 1] and [0, 1] compare unequal.
- assertDictContainsSubset(self, subset, dictionary, msg=None)
- Checks whether dictionary is a superset of subset.
- assertDictEqual(self, d1, d2, msg=None)
- assertEqual(self, first, second, msg=None)
- Fail if the two objects are unequal as determined by the '=='
operator.
- assertEquals = deprecated_func(*args, **kwargs)
- assertFalse(self, expr, msg=None)
- Check that the expression is false.
- assertGreater(self, a, b, msg=None)
- Just like self.assertTrue(a > b), but with a nicer default message.
- assertGreaterEqual(self, a, b, msg=None)
- Just like self.assertTrue(a >= b), but with a nicer default message.
- assertIn(self, member, container, msg=None)
- Just like self.assertTrue(a in b), but with a nicer default message.
- assertIs(self, expr1, expr2, msg=None)
- Just like self.assertTrue(a is b), but with a nicer default message.
- assertIsInstance(self, obj, cls, msg=None)
- Same as self.assertTrue(isinstance(obj, cls)), with a nicer
default message.
- assertIsNone(self, obj, msg=None)
- Same as self.assertTrue(obj is None), with a nicer default message.
- assertIsNot(self, expr1, expr2, msg=None)
- Just like self.assertTrue(a is not b), but with a nicer default message.
- assertIsNotNone(self, obj, msg=None)
- Included for symmetry with assertIsNone.
- assertLess(self, a, b, msg=None)
- Just like self.assertTrue(a < b), but with a nicer default message.
- assertLessEqual(self, a, b, msg=None)
- Just like self.assertTrue(a <= b), but with a nicer default message.
- assertListEqual(self, list1, list2, msg=None)
- A list-specific equality assertion.
Args:
list1: The first list to compare.
list2: The second list to compare.
msg: Optional message to use on failure instead of a list of
differences.
- assertLogs(self, logger=None, level=None)
- Fail unless a log message of level *level* or higher is emitted
on *logger_name* or its children. If omitted, *level* defaults to
INFO and *logger* defaults to the root logger.
This method must be used as a context manager, and will yield
a recording object with two attributes: `output` and `records`.
At the end of the context manager, the `output` attribute will
be a list of the matching formatted log messages and the
`records` attribute will be a list of the corresponding LogRecord
objects.
Example::
with self.assertLogs('foo', level='INFO') as cm:
logging.getLogger('foo').info('first message')
logging.getLogger('foo.bar').error('second message')
self.assertEqual(cm.output, ['INFO:foo:first message',
'ERROR:foo.bar:second message'])
- assertMultiLineEqual(self, first, second, msg=None)
- Assert that two multi-line strings are equal.
- assertNotAlmostEqual(self, first, second, places=None, msg=None, delta=None)
- Fail if the two objects are equal as determined by their
difference rounded to the given number of decimal places
(default 7) and comparing to zero, or by comparing that the
between the two objects is less than the given delta.
Note that decimal places (from zero) are usually not the same
as significant digits (measured from the most signficant digit).
Objects that are equal automatically fail.
- assertNotAlmostEquals = deprecated_func(*args, **kwargs)
- assertNotEqual(self, first, second, msg=None)
- Fail if the two objects are equal as determined by the '!='
operator.
- assertNotEquals = deprecated_func(*args, **kwargs)
- assertNotIn(self, member, container, msg=None)
- Just like self.assertTrue(a not in b), but with a nicer default message.
- assertNotIsInstance(self, obj, cls, msg=None)
- Included for symmetry with assertIsInstance.
- assertNotRegex(self, text, unexpected_regex, msg=None)
- Fail the test if the text matches the regular expression.
- assertRaises(self, excClass, callableObj=None, *args, **kwargs)
- Fail unless an exception of class excClass is raised
by callableObj when invoked with arguments args and keyword
arguments kwargs. If a different type of exception is
raised, it will not be caught, and the test case will be
deemed to have suffered an error, exactly as for an
unexpected exception.
If called with callableObj omitted or None, will return a
context object used like this::
with self.assertRaises(SomeException):
do_something()
An optional keyword argument 'msg' can be provided when assertRaises
is used as a context object.
The context manager keeps a reference to the exception as
the 'exception' attribute. This allows you to inspect the
exception after the assertion::
with self.assertRaises(SomeException) as cm:
do_something()
the_exception = cm.exception
self.assertEqual(the_exception.error_code, 3)
- assertRaisesRegex(self, expected_exception, expected_regex, callable_obj=None, *args, **kwargs)
- Asserts that the message in a raised exception matches a regex.
Args:
expected_exception: Exception class expected to be raised.
expected_regex: Regex (re pattern object or string) expected
to be found in error message.
callable_obj: Function to be called.
msg: Optional message used in case of failure. Can only be used
when assertRaisesRegex is used as a context manager.
args: Extra args.
kwargs: Extra kwargs.
- assertRaisesRegexp = deprecated_func(*args, **kwargs)
- assertRegex(self, text, expected_regex, msg=None)
- Fail the test unless the text matches the regular expression.
- assertRegexpMatches = deprecated_func(*args, **kwargs)
- assertSequenceEqual(self, seq1, seq2, msg=None, seq_type=None)
- An equality assertion for ordered sequences (like lists and tuples).
For the purposes of this function, a valid ordered sequence type is one
which can be indexed, has a length, and has an equality operator.
Args:
seq1: The first sequence to compare.
seq2: The second sequence to compare.
seq_type: The expected datatype of the sequences, or None if no
datatype should be enforced.
msg: Optional message to use on failure instead of a list of
differences.
- assertSetEqual(self, set1, set2, msg=None)
- A set-specific equality assertion.
Args:
set1: The first set to compare.
set2: The second set to compare.
msg: Optional message to use on failure instead of a list of
differences.
assertSetEqual uses ducktyping to support different types of sets, and
is optimized for sets specifically (parameters must support a
difference method).
- assertTrue(self, expr, msg=None)
- Check that the expression is true.
- assertTupleEqual(self, tuple1, tuple2, msg=None)
- A tuple-specific equality assertion.
Args:
tuple1: The first tuple to compare.
tuple2: The second tuple to compare.
msg: Optional message to use on failure instead of a list of
differences.
- assertWarns(self, expected_warning, callable_obj=None, *args, **kwargs)
- Fail unless a warning of class warnClass is triggered
by callable_obj when invoked with arguments args and keyword
arguments kwargs. If a different type of warning is
triggered, it will not be handled: depending on the other
warning filtering rules in effect, it might be silenced, printed
out, or raised as an exception.
If called with callable_obj omitted or None, will return a
context object used like this::
with self.assertWarns(SomeWarning):
do_something()
An optional keyword argument 'msg' can be provided when assertWarns
is used as a context object.
The context manager keeps a reference to the first matching
warning as the 'warning' attribute; similarly, the 'filename'
and 'lineno' attributes give you information about the line
of Python code from which the warning was triggered.
This allows you to inspect the warning after the assertion::
with self.assertWarns(SomeWarning) as cm:
do_something()
the_warning = cm.warning
self.assertEqual(the_warning.some_attribute, 147)
- assertWarnsRegex(self, expected_warning, expected_regex, callable_obj=None, *args, **kwargs)
- Asserts that the message in a triggered warning matches a regexp.
Basic functioning is similar to assertWarns() with the addition
that only warnings whose messages also match the regular expression
are considered successful matches.
Args:
expected_warning: Warning class expected to be triggered.
expected_regex: Regex (re pattern object or string) expected
to be found in error message.
callable_obj: Function to be called.
msg: Optional message used in case of failure. Can only be used
when assertWarnsRegex is used as a context manager.
args: Extra args.
kwargs: Extra kwargs.
- assert_ = deprecated_func(*args, **kwargs)
- countTestCases(self)
- debug(self)
- Run the test without collecting errors in a TestResult
- defaultTestResult(self)
- doCleanups(self)
- Execute all cleanup functions. Normally called for you after
tearDown.
- fail(self, msg=None)
- Fail immediately, with the given message.
- failIf = deprecated_func(*args, **kwargs)
- failIfAlmostEqual = deprecated_func(*args, **kwargs)
- failIfEqual = deprecated_func(*args, **kwargs)
- failUnless = deprecated_func(*args, **kwargs)
- failUnlessAlmostEqual = deprecated_func(*args, **kwargs)
- failUnlessEqual = deprecated_func(*args, **kwargs)
- failUnlessRaises = deprecated_func(*args, **kwargs)
- id(self)
- run(self, result=None)
- setUp(self)
- Hook method for setting up the test fixture before exercising it.
- shortDescription(self)
- Returns a one-line description of the test, or None if no
description has been provided.
The default implementation of this method returns the first line of
the specified test method's docstring.
- skipTest(self, reason)
- Skip this test.
- subTest(self, msg=None, **params)
- Return a context manager that will return the enclosed block
of code in a subtest identified by the optional message and
keyword parameters. A failure in the subtest marks the test
case as failed but resumes execution at the end of the enclosed
block, allowing further test code to be executed.
- tearDown(self)
- Hook method for deconstructing the test fixture after testing it.
Class methods inherited from unittest.case.TestCase:
- tearDownClass() from builtins.type
- Hook method for deconstructing the class fixture after running all tests in the class.
Data descriptors inherited from unittest.case.TestCase:
- __dict__
- dictionary for instance variables (if defined)
- __weakref__
- list of weak references to the object (if defined)
Data and other attributes inherited from unittest.case.TestCase:
- failureException = <class 'AssertionError'>
- Assertion failed.
- longMessage = True
- maxDiff = 640
|
class ViewTest(django.test.testcases.TestCase) |
| |
Tests for the application views. |
| |
- Method resolution order:
- ViewTest
- django.test.testcases.TestCase
- django.test.testcases.TransactionTestCase
- django.test.testcases.SimpleTestCase
- unittest.case.TestCase
- builtins.object
Methods defined here:
- test_about(self)
- Tests the about page.
Class methods defined here:
- setUpClass() from builtins.type
- # Django 1.7 requires an explicit setup() when running tests in PTVS
Methods inherited from django.test.testcases.TransactionTestCase:
- assertNumQueries(self, num, func=None, *args, **kwargs)
- assertQuerysetEqual(self, qs, values, transform=, ordered=True, msg=None)
Data and other attributes inherited from django.test.testcases.TransactionTestCase:
- available_apps = None
- fixtures = None
- reset_sequences = False
- serialized_rollback = False
Methods inherited from django.test.testcases.SimpleTestCase:
- __call__(self, result=None)
- Wrapper around default __call__ method to perform common Django test
set up. This means that user-defined Test Cases aren't required to
include a call to super().setUp().
- assertContains(self, response, text, count=None, status_code=200, msg_prefix='', html=False)
- Asserts that a response indicates that some content was retrieved
successfully, (i.e., the HTTP status code was as expected), and that
``text`` occurs ``count`` times in the content of the response.
If ``count`` is None, the count doesn't matter - the assertion is true
if the text occurs at least once in the response.
- assertFieldOutput(self, fieldclass, valid, invalid, field_args=None, field_kwargs=None, empty_value='')
- Asserts that a form field behaves correctly with various inputs.
Args:
fieldclass: the class of the field to be tested.
valid: a dictionary mapping valid inputs to their expected
cleaned values.
invalid: a dictionary mapping invalid inputs to one or more
raised error messages.
field_args: the args passed to instantiate the field
field_kwargs: the kwargs passed to instantiate the field
empty_value: the expected clean output for inputs in empty_values
- assertFormError(self, response, form, field, errors, msg_prefix='')
- Asserts that a form used to render the response has a specific field
error.
- assertFormsetError(self, response, formset, form_index, field, errors, msg_prefix='')
- Asserts that a formset used to render the response has a specific error.
For field errors, specify the ``form_index`` and the ``field``.
For non-field errors, specify the ``form_index`` and the ``field`` as
None.
For non-form errors, specify ``form_index`` as None and the ``field``
as None.
- assertHTMLEqual(self, html1, html2, msg=None)
- Asserts that two HTML snippets are semantically the same.
Whitespace in most cases is ignored, and attribute ordering is not
significant. The passed-in arguments must be valid HTML.
- assertHTMLNotEqual(self, html1, html2, msg=None)
- Asserts that two HTML snippets are not semantically equivalent.
- assertInHTML(self, needle, haystack, count=None, msg_prefix='')
- assertJSONEqual(self, raw, expected_data, msg=None)
- assertNotContains(self, response, text, status_code=200, msg_prefix='', html=False)
- Asserts that a response indicates that some content was retrieved
successfully, (i.e., the HTTP status code was as expected), and that
``text`` doesn't occurs in the content of the response.
- assertRaisesMessage(self, expected_exception, expected_message, callable_obj=None, *args, **kwargs)
- Asserts that the message in a raised exception matches the passed
value.
Args:
expected_exception: Exception class expected to be raised.
expected_message: expected error message string value.
callable_obj: Function to be called.
args: Extra args.
kwargs: Extra kwargs.
- assertRedirects(self, response, expected_url, status_code=302, target_status_code=200, host=None, msg_prefix='', fetch_redirect_response=True)
- Asserts that a response redirected to a specific URL, and that the
redirect URL can be loaded.
Note that assertRedirects won't work for external links since it uses
TestClient to do a request (use fetch_redirect_response=False to check
such links without fetching them).
- assertTemplateNotUsed(self, response=None, template_name=None, msg_prefix='')
- Asserts that the template with the provided name was NOT used in
rendering the response. Also usable as context manager.
- assertTemplateUsed(self, response=None, template_name=None, msg_prefix='')
- Asserts that the template with the provided name was used in rendering
the response. Also usable as context manager.
- assertXMLEqual(self, xml1, xml2, msg=None)
- Asserts that two XML snippets are semantically the same.
Whitespace in most cases is ignored, and attribute ordering is not
significant. The passed-in arguments must be valid XML.
- assertXMLNotEqual(self, xml1, xml2, msg=None)
- Asserts that two XML snippets are not semantically equivalent.
Whitespace in most cases is ignored, and attribute ordering is not
significant. The passed-in arguments must be valid XML.
- modify_settings(self, **kwargs)
- A context manager that temporarily applies changes a list setting and
reverts back to the original value when exiting the context.
- settings(self, **kwargs)
- A context manager that temporarily sets a setting and reverts to the original value when exiting the context.
Data and other attributes inherited from django.test.testcases.SimpleTestCase:
- client_class = <class 'django.test.client.Client'>
- A class that can act as a client for testing purposes.
It allows the user to compose GET and POST requests, and
obtain the response that the server gave to those requests.
The server Response objects are annotated with the details
of the contexts and templates that were rendered during the
process of serving the request.
Client objects are stateful - they will retain cookie (and
thus session) details for the lifetime of the Client instance.
This is not intended as a replacement for Twill/Selenium or
the like - it is here to allow testing against the
contexts and templates produced by a view, rather than the
HTML rendered to the end-user.
Methods inherited from unittest.case.TestCase:
- __eq__(self, other)
- __hash__(self)
- __init__(self, methodName='runTest')
- Create an instance of the class that will use the named test
method when executed. Raises a ValueError if the instance does
not have a method with the specified name.
- __repr__(self)
- __str__(self)
- addCleanup(self, function, *args, **kwargs)
- Add a function, with arguments, to be called when the test is
completed. Functions added are called on a LIFO basis and are
called after tearDown on test failure or success.
Cleanup items are called even if setUp fails (unlike tearDown).
- addTypeEqualityFunc(self, typeobj, function)
- Add a type specific assertEqual style function to compare a type.
This method is for use by TestCase subclasses that need to register
their own type equality functions to provide nicer error messages.
Args:
typeobj: The data type to call this function on when both values
are of the same type in assertEqual().
function: The callable taking two arguments and an optional
msg= argument that raises self.failureException with a
useful error message when the two arguments are not equal.
- assertAlmostEqual(self, first, second, places=None, msg=None, delta=None)
- Fail if the two objects are unequal as determined by their
difference rounded to the given number of decimal places
(default 7) and comparing to zero, or by comparing that the
between the two objects is more than the given delta.
Note that decimal places (from zero) are usually not the same
as significant digits (measured from the most signficant digit).
If the two objects compare equal then they will automatically
compare almost equal.
- assertAlmostEquals = deprecated_func(*args, **kwargs)
- assertCountEqual(self, first, second, msg=None)
- An unordered sequence comparison asserting that the same elements,
regardless of order. If the same element occurs more than once,
it verifies that the elements occur the same number of times.
self.assertEqual(Counter(list(first)),
Counter(list(second)))
Example:
- [0, 1, 1] and [1, 0, 1] compare equal.
- [0, 0, 1] and [0, 1] compare unequal.
- assertDictContainsSubset(self, subset, dictionary, msg=None)
- Checks whether dictionary is a superset of subset.
- assertDictEqual(self, d1, d2, msg=None)
- assertEqual(self, first, second, msg=None)
- Fail if the two objects are unequal as determined by the '=='
operator.
- assertEquals = deprecated_func(*args, **kwargs)
- assertFalse(self, expr, msg=None)
- Check that the expression is false.
- assertGreater(self, a, b, msg=None)
- Just like self.assertTrue(a > b), but with a nicer default message.
- assertGreaterEqual(self, a, b, msg=None)
- Just like self.assertTrue(a >= b), but with a nicer default message.
- assertIn(self, member, container, msg=None)
- Just like self.assertTrue(a in b), but with a nicer default message.
- assertIs(self, expr1, expr2, msg=None)
- Just like self.assertTrue(a is b), but with a nicer default message.
- assertIsInstance(self, obj, cls, msg=None)
- Same as self.assertTrue(isinstance(obj, cls)), with a nicer
default message.
- assertIsNone(self, obj, msg=None)
- Same as self.assertTrue(obj is None), with a nicer default message.
- assertIsNot(self, expr1, expr2, msg=None)
- Just like self.assertTrue(a is not b), but with a nicer default message.
- assertIsNotNone(self, obj, msg=None)
- Included for symmetry with assertIsNone.
- assertLess(self, a, b, msg=None)
- Just like self.assertTrue(a < b), but with a nicer default message.
- assertLessEqual(self, a, b, msg=None)
- Just like self.assertTrue(a <= b), but with a nicer default message.
- assertListEqual(self, list1, list2, msg=None)
- A list-specific equality assertion.
Args:
list1: The first list to compare.
list2: The second list to compare.
msg: Optional message to use on failure instead of a list of
differences.
- assertLogs(self, logger=None, level=None)
- Fail unless a log message of level *level* or higher is emitted
on *logger_name* or its children. If omitted, *level* defaults to
INFO and *logger* defaults to the root logger.
This method must be used as a context manager, and will yield
a recording object with two attributes: `output` and `records`.
At the end of the context manager, the `output` attribute will
be a list of the matching formatted log messages and the
`records` attribute will be a list of the corresponding LogRecord
objects.
Example::
with self.assertLogs('foo', level='INFO') as cm:
logging.getLogger('foo').info('first message')
logging.getLogger('foo.bar').error('second message')
self.assertEqual(cm.output, ['INFO:foo:first message',
'ERROR:foo.bar:second message'])
- assertMultiLineEqual(self, first, second, msg=None)
- Assert that two multi-line strings are equal.
- assertNotAlmostEqual(self, first, second, places=None, msg=None, delta=None)
- Fail if the two objects are equal as determined by their
difference rounded to the given number of decimal places
(default 7) and comparing to zero, or by comparing that the
between the two objects is less than the given delta.
Note that decimal places (from zero) are usually not the same
as significant digits (measured from the most signficant digit).
Objects that are equal automatically fail.
- assertNotAlmostEquals = deprecated_func(*args, **kwargs)
- assertNotEqual(self, first, second, msg=None)
- Fail if the two objects are equal as determined by the '!='
operator.
- assertNotEquals = deprecated_func(*args, **kwargs)
- assertNotIn(self, member, container, msg=None)
- Just like self.assertTrue(a not in b), but with a nicer default message.
- assertNotIsInstance(self, obj, cls, msg=None)
- Included for symmetry with assertIsInstance.
- assertNotRegex(self, text, unexpected_regex, msg=None)
- Fail the test if the text matches the regular expression.
- assertRaises(self, excClass, callableObj=None, *args, **kwargs)
- Fail unless an exception of class excClass is raised
by callableObj when invoked with arguments args and keyword
arguments kwargs. If a different type of exception is
raised, it will not be caught, and the test case will be
deemed to have suffered an error, exactly as for an
unexpected exception.
If called with callableObj omitted or None, will return a
context object used like this::
with self.assertRaises(SomeException):
do_something()
An optional keyword argument 'msg' can be provided when assertRaises
is used as a context object.
The context manager keeps a reference to the exception as
the 'exception' attribute. This allows you to inspect the
exception after the assertion::
with self.assertRaises(SomeException) as cm:
do_something()
the_exception = cm.exception
self.assertEqual(the_exception.error_code, 3)
- assertRaisesRegex(self, expected_exception, expected_regex, callable_obj=None, *args, **kwargs)
- Asserts that the message in a raised exception matches a regex.
Args:
expected_exception: Exception class expected to be raised.
expected_regex: Regex (re pattern object or string) expected
to be found in error message.
callable_obj: Function to be called.
msg: Optional message used in case of failure. Can only be used
when assertRaisesRegex is used as a context manager.
args: Extra args.
kwargs: Extra kwargs.
- assertRaisesRegexp = deprecated_func(*args, **kwargs)
- assertRegex(self, text, expected_regex, msg=None)
- Fail the test unless the text matches the regular expression.
- assertRegexpMatches = deprecated_func(*args, **kwargs)
- assertSequenceEqual(self, seq1, seq2, msg=None, seq_type=None)
- An equality assertion for ordered sequences (like lists and tuples).
For the purposes of this function, a valid ordered sequence type is one
which can be indexed, has a length, and has an equality operator.
Args:
seq1: The first sequence to compare.
seq2: The second sequence to compare.
seq_type: The expected datatype of the sequences, or None if no
datatype should be enforced.
msg: Optional message to use on failure instead of a list of
differences.
- assertSetEqual(self, set1, set2, msg=None)
- A set-specific equality assertion.
Args:
set1: The first set to compare.
set2: The second set to compare.
msg: Optional message to use on failure instead of a list of
differences.
assertSetEqual uses ducktyping to support different types of sets, and
is optimized for sets specifically (parameters must support a
difference method).
- assertTrue(self, expr, msg=None)
- Check that the expression is true.
- assertTupleEqual(self, tuple1, tuple2, msg=None)
- A tuple-specific equality assertion.
Args:
tuple1: The first tuple to compare.
tuple2: The second tuple to compare.
msg: Optional message to use on failure instead of a list of
differences.
- assertWarns(self, expected_warning, callable_obj=None, *args, **kwargs)
- Fail unless a warning of class warnClass is triggered
by callable_obj when invoked with arguments args and keyword
arguments kwargs. If a different type of warning is
triggered, it will not be handled: depending on the other
warning filtering rules in effect, it might be silenced, printed
out, or raised as an exception.
If called with callable_obj omitted or None, will return a
context object used like this::
with self.assertWarns(SomeWarning):
do_something()
An optional keyword argument 'msg' can be provided when assertWarns
is used as a context object.
The context manager keeps a reference to the first matching
warning as the 'warning' attribute; similarly, the 'filename'
and 'lineno' attributes give you information about the line
of Python code from which the warning was triggered.
This allows you to inspect the warning after the assertion::
with self.assertWarns(SomeWarning) as cm:
do_something()
the_warning = cm.warning
self.assertEqual(the_warning.some_attribute, 147)
- assertWarnsRegex(self, expected_warning, expected_regex, callable_obj=None, *args, **kwargs)
- Asserts that the message in a triggered warning matches a regexp.
Basic functioning is similar to assertWarns() with the addition
that only warnings whose messages also match the regular expression
are considered successful matches.
Args:
expected_warning: Warning class expected to be triggered.
expected_regex: Regex (re pattern object or string) expected
to be found in error message.
callable_obj: Function to be called.
msg: Optional message used in case of failure. Can only be used
when assertWarnsRegex is used as a context manager.
args: Extra args.
kwargs: Extra kwargs.
- assert_ = deprecated_func(*args, **kwargs)
- countTestCases(self)
- debug(self)
- Run the test without collecting errors in a TestResult
- defaultTestResult(self)
- doCleanups(self)
- Execute all cleanup functions. Normally called for you after
tearDown.
- fail(self, msg=None)
- Fail immediately, with the given message.
- failIf = deprecated_func(*args, **kwargs)
- failIfAlmostEqual = deprecated_func(*args, **kwargs)
- failIfEqual = deprecated_func(*args, **kwargs)
- failUnless = deprecated_func(*args, **kwargs)
- failUnlessAlmostEqual = deprecated_func(*args, **kwargs)
- failUnlessEqual = deprecated_func(*args, **kwargs)
- failUnlessRaises = deprecated_func(*args, **kwargs)
- id(self)
- run(self, result=None)
- setUp(self)
- Hook method for setting up the test fixture before exercising it.
- shortDescription(self)
- Returns a one-line description of the test, or None if no
description has been provided.
The default implementation of this method returns the first line of
the specified test method's docstring.
- skipTest(self, reason)
- Skip this test.
- subTest(self, msg=None, **params)
- Return a context manager that will return the enclosed block
of code in a subtest identified by the optional message and
keyword parameters. A failure in the subtest marks the test
case as failed but resumes execution at the end of the enclosed
block, allowing further test code to be executed.
- tearDown(self)
- Hook method for deconstructing the test fixture after testing it.
Class methods inherited from unittest.case.TestCase:
- tearDownClass() from builtins.type
- Hook method for deconstructing the class fixture after running all tests in the class.
Data descriptors inherited from unittest.case.TestCase:
- __dict__
- dictionary for instance variables (if defined)
- __weakref__
- list of weak references to the object (if defined)
Data and other attributes inherited from unittest.case.TestCase:
- failureException = <class 'AssertionError'>
- Assertion failed.
- longMessage = True
- maxDiff = 640
| |


Below you will find my current book, the first of a series, free for you.
Its original version is bilingual.
Characters speak in Spanish and English, and think in the language they prefer.
Contribute to the development of this webpage and I will create a character of your choosing which will appear in my books. Additionally, and your name or your characters' will be displayed in the wall of heroes, here in this page.
Explore the CodeFollow me on Patreon and Instagram and learn how you can send me your character to appear on the continuation of the Nova Series
Ticket to Second Moon's Bay


Log In/Sign Up
{{vendorNameTruncated}} Savings
Top Deals
Notifications
{{vendorName}} Offers
Price Comparison
Special Offers
User Activity
Toggle notification for:


{% extends 'layout-full.html' %}
{% block title -%}
Paying for College feedback | Consumer Financial Protection Bureau
{%- endblock %}
{% block content_main %}
Give us feedback on Paying for College
We’ll be sure to review your ideas and input, which will help us make the financial aid tool even more helpful!


Welcome to Beartooth Hiking
Sign up for your hiking trip here!
Gardiner Lake (3 or 5 days)
Hellroaring Plateau (2, 3 or 4 days)
The Beaten Path (5 or 7 days)
Enter Number of Days for Hike:
Enter Number of People (1-10):
Enter Date for Hike:


When you first start to play around with CSS you will come to understand that everything (text, images, all content)
has a box around it.
You may not see this box at first, but you will soon praise this box.
This ‘box’ is made up of a few different things…
The content is whatever it is you have inserted into your HTML.
It could be some text saying “Hello world” or maybe an image of a gazebo.
This content can be sized with the width and height properties.
The padding is what sits around the content and ‘lets it breathe’. It's an invisible space that is controlled by the padding property in CSS.
When you increase the padding your content will essentially be getting 'squeezed' smaller
The border is exactly what you think it is, it’s a border that sits around the content AND the padding.
Just like padding it can be controlled (sized, styled)
by using the border property in CSS.
The border is mainly used as an aesthetic element, or for debugging purposes.
The margin is outside everything else we have mentioned. It sits after the border. It wraps together the content, padding, and border in one box and separates
it from another piece of content or another ‘element’ as we call it in HTML.
Just like the padding it's also invisible (whitespace), and it can be controlled
using the margin property in CSS. When you increase the margin you are 'pushing' the other elements on the page out of the way.
So let's remember we are talking about a box here, and what does a box have?
4 sides.
Enough of me writing words.. Show me some pictures!
Image showing the box model
This image might be difficult to understand at first, so let’s use an analogy:
Imagine you climb inside a really big cardboard box.
You are the 'content'. The space between you and cardboard box is the padding. Think of the box as the border, and then the
space outside the box is the margin.
You can size the padding, border, margin for all 4 sides of your element. To help with this we have very clear CSS properties to target each side of the box.
Padding-top, padding-bottom, padding-left, padding-right.
Border-top, border-bottom, border-left, border-right
Margin-top, margin-bottom, margin-left, margin-right
Phew! That’s a lot of typing! Fortunately there are shortcuts!
Padding: top, right, bottom, left;
So in code we can write for example:
Padding: 3px 5px 3px 5px;
Notice how it goes clockwise, top, right, bottom, left.. And that's the same for border and margin!
An awesome feature of your internet browser is the developer tools.
When you want to work with CSS, right-click an element on the page (in your browser) and select Inspect to jump into the Elements panel. Or press Command+Option+C (Mac)
or Control+Shift+C (Windows, Linux, Chrome OS).
Built into the developer tools is a little interactive box model, which looks like this:
Screenshot of Google Chrome's Box Model
With this feature you can easily see the sizes of the content, padding and margin of a particular element.
This is very helpful for when elements are weirdly sized,
or maybe they are pushing other elements on the page (margin). Use this tool to help debug your code!
Awesome, so what next? you’re probably thinking which one to use and when?
The truth is, I could sit here explaining it to you all day.
But the only way you will really learn is if you go and have a play with it yourself. Break your code and then try and fix it.


Use one of your social logins to manage your
login on wagerr.com
{{socialCreate()}}
Anonymous Account Created
No Email. No Password.
ACTION REQUIRED
You must back up your SEED (12-word passphrase) to
secure your account.
1.
Your account is temporarily stored as a cookie in your browser. If your cookies are cleared, blocked or deleted, you will lose access to your funds. Permanently.
2.
If you back up your SEED securely, you will always be able to re-import your account.
3.
Keep it secret. If anyone else gains access to your SEED, they can access your funds.
Your SEED is these 12 words
{{genMnemonic.word1}}
{{genMnemonic.word2}}
{{genMnemonic.word3}}
{{genMnemonic.word4}}
{{genMnemonic.word5}}
{{genMnemonic.word6}}
{{genMnemonic.word7}}
{{genMnemonic.word8}}
{{genMnemonic.word9}}
{{genMnemonic.word10}}
{{genMnemonic.word11}}
{{genMnemonic.word12}}
Account
Regular Account
Use one of your social logins to manage your
login on wagerr.com


| Overview | Module | Use | Devguide | Index |
| Services' Summary | Interfaces' Summary | Properties' Summary | Services' Details | Interfaces' Details | Properties' Details |
| service RenderOptions |
|
| Properties' Summary | |
| ::com::sun::star::awt::XDevice RenderDevice |
specifies the device the page should be rendered to |
| boolean IsFirstPage |
[ OPTIONAL ] indicates that the current page is the first page to be exported. |
| boolean IsLastPage |
[ OPTIONAL ] indicates that the current page is the last page to be exported. |
| boolean IsSkipEmptyPages |
[ OPTIONAL ] specifies if empty pages should be skipped. |
| string PageRange |
[ OPTIONAL ] specifies the page ranges to be rendered. |
| Properties' Details | |
RenderDevice
|
|
IsFirstPage
|
|
IsLastPage
|
|
IsSkipEmptyPages
|
|
PageRange
|
Copyright © 2013, The Apache Software Foundation, Licensed under the Apache License, Version 2.0. Apache, the Apache feather logo, Apache OpenOffice and OpenOffice.org are trademarks of The Apache Software Foundation. Other names may be trademarks of their respective owners.


Configure Federations¶
Create a user with a federations role (Misc -> Users -> Add User). This user will have the ability to perform the following actions:
- Edit the federation
- Delete the federation
- Add IPV4 resolvers
- Add IPV6 resolvers
- As a user with admin priveleges, create a Federation Mapping by going to Delivery Services -> Federations and then clicking ‘Add Federation Mapping’
- Choose the Delivery Service for the federation to be mapped to and assign it to the Federation User; click Add.
After the Federation is added, Traffic Ops will display the Federation.
Changes can be made at this time or the Federation can be deleted. Notice that no resolvers have been added to the fedeation yet. This can only be done by the federation user created in step 1.
If no further action is necessary, the Close button will close the window and display the list of all Federations.
The Federation user can now add resolvers to the Federation Mapping in Traffic Ops.
The federation user logs to traffic ops and stores the mojolicious cookie. The mojolicious cookie can be obtained manually using the debug tools on a web browser or via curl.
Example:
$ curl -i -XPOST "http://localhost:3000/api/1.1/user/login" -H "Content-Type: application/json" -d '{ "u": "federation_user1", "p": "password" }' HTTP/1.1 200 OK Date: Wed, 02 Dec 2015 21:12:06 GMT Content-Length: 65 Access-Control-Allow-Credentials: true Content-Type: application/json Access-Control-Allow-Methods: POST,GET,OPTIONS,PUT,DELETE Set-Cookie: mojolicious=eyJleHBpcmVzIjoxNDQ5MTA1MTI2LCJhdXRoX2RhdGEiOiJmZWRlcmF0aW9uX3VzZXIxIn0---06b4f870d809d82a91433e92eae8320875c3e8b0; expires=Thu, 03 Dec 2015 01:12:06 GMT; path=/; HttpOnly Server: Mojolicious (Perl) Access-Control-Allow-Headers: Origin, X-Requested-With, Content-Type, Accept Cache-Control: no-cache, no-store, max-age=0, must-revalidate Connection: keep-alive Access-Control-Allow-Origin: http://localhost:8080 {"alerts":[{"level":"success","text":"Successfully logged in."}]}
The federation user sends a request to Traffic Ops to add IPV4 and/or IPV6 resolvers
Example:
$ curl -ki -H "Cookie: mojolicious=eyJleHBpcmVzIjoxNDQ5MTA1MTI2LCJhdXRoX2RhdGEiOiJmZWRlcmF0aW9uX3VzZXIxIn0---06b4f870d809d82a91433e92eae8320875c3e8b0;" -XPUT 'http://localhost:3000/api/1.2/federations' -d ' {"federations": [ { "deliveryService": "images-c1", "mappings": { "resolve4": [ "<IP_ADDRESS>/32", "<IP_ADDRESS>/32" ], "resolve6": ["2001:4860:4860::8888/128", "2001:4860:4860::8844"] } } ] }' HTTP/1.1 200 OK Set-Cookie: mojolicious=eyJleHBpcmVzIjoxNDQ5MTA1OTQyLCJhdXRoX2RhdGEiOiJmZWRlcmF0aW9uX3VzZXIxIn0---b42be0749415cefd1d14e1a91bb214845b4de556; expires=Thu, 03 Dec 2015 01:25:42 GMT; path=/; HttpOnly Server: Mojolicious (Perl) Date: Wed, 02 Dec 2015 21:25:42 GMT Content-Length: 74 Access-Control-Allow-Credentials: true Content-Type: application/json Access-Control-Allow-Methods: POST,GET,OPTIONS,PUT,DELETE Cache-Control: no-cache, no-store, max-age=0, must-revalidate Access-Control-Allow-Origin: http://localhost:8080 Connection: keep-alive Access-Control-Allow-Headers: Origin, X-Requested-With, Content-Type, Accept {"response":"federation_user1 successfully created federation resolvers."}
The resolvers added by the federation user will now visible in Traffic Ops.
Any requests made from a client that resolves to one of the federation resolvers will now be given a CNAME from Traffic Router.


ART GALLERY
VIEW ALL IMAGES
FOOD
TECH
SPORTS
TRAVEL
(current)
-->
Click To Navigate To The Search Area


|
Copley Motion Library
|
Analog input configuration. More...
Public Member Functions | |
| AnalogRefConfig (void) | |
| Default constructor. Simply sets all members to zero. | |
Public Attributes | |
| int16 | calibration |
| Calibration offset. More... | |
| int16 | offset |
| Offset in millivolts. | |
| int16 | deadband |
| Deadband in millivolts. More... | |
| int32 | scale |
| Scaling factor. More... | |
Analog input configuration.
These parameters are used when the amplifier is being driven from it's analog reference input pin. Note that not all amplifier have an analog input reference, and that this is not a standard CANopen mode of operation.
| int16 calibration |
Calibration offset.
This offset is set at the factory and should normally not be modified. Units are millivolts
| int16 deadband |
Deadband in millivolts.
The analog input will be treated as zero when it's absolute value is less then this.
| int32 scale |
Scaling factor.
Units are dependent on the mode of operation: 0.01 Amp when driving current. 0.1 Encoder counts/second when driving velocity


Thought Alive, Code as expression, poetics of emergence - Rodrigo Velasco
There's an embodiment of philosophical concepts at the heart of my artistic practice, which entails the creation of propositions and events,
where thought is in motion and is transversally activated by different computational techniques
and collaboration allowing us to experience the emergence of the relational fields.
/ To improvise by writing algorithms from the recombination of formal logic and poetic expression.
We did not invent computers, we invented machines to help us compute' (McLean, 2011, 13).
Relational fields, as I understand them, are openings onto experience where experience is not yet.
/ A relational approach grows from inside and is a call for co-emergence and interdependence (Goodman 2018, 44) where a multiplicity of non-linear flows overlap and move into play with no particular endpoint.
This experience involves an awareness of research-creation as an interwoven concept, which does not seek to separate research from creation: it creates conditions for new ways of encountering study.
/ Research-creation is approached as an active hyphen that brings making to thinking and thinking to making (Manning 2016, 13).
; The interstitial place from where
these processes emerge is from an active practice of writing algorithms as
thoughts.
Thought Alive, Code as expression, poetics of emergence - Rodrigo Velasco
How can generative processes and improvisation through live coding strengthen the potential of newways of coming into relation in the digital space?
How complex relational environments can be crafted through writing algorithms?
How can the writing of algorithms tion allowing us give life to a relational experience where unpredictable movements of thought and sensation transit between given potentials and unknown events?
/ How can we sense the currents of the relational field?
How live coding and algorithmic processes can enable the emergence of a non-linear process of thought to be experienced?
The force of change that activates the event works in the mode of speculative pragmatism, bringing with it an aspect of discovery, as it pushes the work to
its overflow and this feedback into the process, so that it allows us to touch on the ineffable quality of its more-than. This makes it speculative.
Speculative pragmatism, speculative in the sense that the process remains open to the more-than,
and pragmatic in the sense that it is completely invested in its 'something doing.' (Massumi 2016, 33).
The interstice of art and philosophy that unfolds into various propositions and events through my research-creation, embrace speculative pragmatism as a technique that redirects its tendencies and helps keep it in movement.
/ How computational techniques strengthens the potential to create unpredictable movements of color and frequency, where thought and sensation transit between given potentials and unknown events?
/ led me to this mode of study: growing from inside my practice there is a rigor for experimentation that is generative of knowledge.
The artistic work that I have been doing before and during the Master of Design has gradually
Generative Design And Net.Art*
Thought Alive workshop.
Eastern Bloc, 7/14/21.03.2020
The power of the spill, *
Csenge Kolozsvari + Rodrigo Velasco
MilieuXBauhaus
05.11.2019
Spoken Code
/ Spoken Web*
Visualization Studio, 27.09.2019
/
Niyolchoca,
TOPO Laboratoire
d'ecritures numériques
Installation en vitrine
20.02.20 au 28.03.20
/
Niyolchoca,
TOPO Laboratoire
d'ecritures numériques
Installation en vitrine
20.02.20 au 28.03.20
/
Niyolchoca,
TOPO Laboratoire
d'ecritures numériques
Installation en vitrine
20.02.20 au 28.03.20
Resolana
Conversational poetics, codework to be exhibited at MDes, Interstice Exhibition.


Lights Out Premiere: Viktor Kalima - Protruder [Tripalium Corp]
Urgent, funky, and menacing blend of techno and EBM
by KaneToday, Lights Out brings you an exclusive premiere from taste-making French label Tripalium Corp, in the form of Viktor Kalima's 'Protruder'. The title track of his upcoming 6-track EP as part of the labels Digital Mutant Series, Protruder is an urgent, funky, and menacing blend of techno and EBM, with a dash of acid for good measure. What really stands out about this track is the amount of space between the elements that allows each to shine brightly. Tripalium has a knack for finding talent that is hard to define by a single genre, Viktor Kalima being a perfect example. 'Prodtruder' by Viktor Kalima will be released on November 21st via Tripalium Corp.
Track: Protruder
Artist: Viktor Kalima
Label: Tripalium Corp
Format: Digital/Vinyl
Release Date: 11-21-19


Home
Features
Courses
Log in / Sign Up
Home
Features
Courses
Login
Signup
UISTACADEMY
Log in / Sign Up
courses


{% extends "global/Page.html" %} {% load otree %} {% block title %} Story 5 {% endblock %} {% block content %} Please read the following story:
As the conductor moved to the next train compartment, a young man tried to sneak past him. {{story_p1}}. {{story_p2}}. {{story_p3}}. {{story_p4}}. {{story_p5}}. {{story_p6}}. {{story_p7}}. {{story_p8}}.
{% formfields%}
{% next_button %} {{ form.errors }} {% endblock %}


Learn how to study effectively and get BETTER grades
Our E-book explains how to manage your Study life effectively
Enter Email
I WANT THE BOOK
I want to receive information on how to study effectively daily