Testing

This package includes both Python and Extender Unit testing as well as an Extender Acceptance Test.

class poplar_isocc.tests.test_poplar_isocc.IsoCountryCodeTestCase(methodName='runTest')[source]

Bases: unittest.case.TestCase

Unit tests for ISO country code validation.

test_is_valid_iso_cc()[source]

Test that the ISO code validation function works as expected.

  1. For each code in a list of valid codes, verify that the validation passes.
  2. For each code in a list of invalid codes, including overlength and empty values, verify that the validation fails.
class poplar_isocc.tests.extest_poplar_isocc.IsoCountryCodeTestCase(log_level=15)[source]

Bases: extools.extest.ExTestCase

Unit tests for ISO country code validation.

test_is_valid_iso_cc()[source]

Passes iff the validation works for a valid, invalid and empty country code in SAMINC.

  1. Open a record with a valid country code, verify it validates.
  2. Open a record with an invalid country code, verify validation fails.
  3. Open a record with an empty country code, verify validation fails.
class poplar_isocc.tests.extest_poplar_isocc.IsoCountryCodeAcceptanceTestCase(log_level=15)[source]

Bases: extools.extest.ExTestCase

Acceptance tests for ISO country code validation.

test_is_valid_iso_enforced_in_view()[source]

Verify that a ISO code validation is enforced at the view.

  1. Navigate to a record with an empty country code.
  2. Put an invalid country code in the field (raises ExViewError).
  3. Put a valid country code in the field (succeeds).