Code review comment for lp:~leonardr/lazr.restful/forbid-reference-to-entry-not-published-in-this-version

Revision history for this message
Leonard Richardson (leonardr) wrote :

I figured out why I was worried about not having all the tests. Basically, I didn't expect test_reference_to_object_published_earlier_succeeds() to work and I was surprised that it did. I didn't understand why the code I wrote would find IPublishedEarly in 2.0 when it was defined in 1.0 and not changed afterwards.

The answer is that lazr.restful creates and registers an IEntry adapter for each published entry for each version. It's not smart enough to see that an entry hasn't changed since the last version. Now that lack of optimization has paid off.

« Back to merge proposal