facebook/facebook-python-ads-sdk — pull request #23 by agriffis (2014-12-14 01:06:42+00:00)
Title: Delete remote objects after tests.

My ad account is getting cluttered with integration test junk. There are two
problems leading to this:

1. The remote test objects aren't consistently deleted at the end of
tests.

2. Some of the deletions are handled at the end of the test, rather than
in tearDown, so they don't happen if the test fails.

This commit solves problem by keeping a list of `self.remote_objects` which is
deleted automatically in `FacebookAdsTestCase.tearDown`. (It should probably
be `AbstractCrudObjectTestCase.tearDown` but that's an orthoganol issue for a
separate commit. The `new_test_ad_*` methods are on
`FacebookAdsTestCase` and they call `remote_create` so that's the class where
automatic deletion needs to be handled as well, for now.)

Additionally this commit cleans up the calling of `set_default_read_fields` so
that it's always restored in `tearDown` at the end of each test, to prevent
cross-test pollution.