UNC BACS 350

Web Apps with Python/Django

Logo

Lesson 40 - Page Probe Tests

LEARN

End of Course

Office Hours

Today

Catalog of Design Patterns

Shrinking World Testing

Django Tests

Page Probe Tests

python def execute_probe(probe): try: response = get(probe.page) except: response = None if not response: status = f'Status Code: Domain not found, {probe.page}' passed = False elif response.status_code != 200: status = f'Status Code: {response.status_code}' passed = False elif probe.text not in response.text: status = f'Text not found: {probe.text}' passed = False else: status = f'Matched: {probe.text}' passed = True Result.create(probe=probe, output=status, passed=passed)

Hammer Script Tests

BUILD

Practice