A Code Horror Story

You have inherited

10 000 SLOCs

Without a single test case

How does that make you feel ?

PLOT

Fix an object detail page

runserver

Browse manually

Learn the codebase

git commit -m wip

Coffee

Preventing regressions

Should be a one-liner

# Should be a one-liner
assertNoDiff('/widgets/1/')

Title Text

from django import test

from responsediff.test import ResponseDiffTestMixin


class MixinTest(ResponseDiffTestMixin, test.TestCase):
    fixtures = ['your_object.json']

    def test_admin(self):
        self.assertResponseDiffEmpty(test.Client().get('/admin/'))

Testing legacy code

By James Pic

Testing legacy code

  • 1,329