kula1922/ralph_pricing — pull request #1 by mkurek (2014-01-10 14:21:28+00:00)
Title: fix unit tests; remove power consumption and warehouse from dailydevice;...

... fix reports generating; remove power consumption plugin

First of all I've removed power consumption plugin - all power consumption data all obtained using assets plugin, so we can create DailyUsage while updating assets (just like we're now creating cores count DailyUsage). Your power consumption plugin just rewrites data from one table to another.

Second of all - I've removed memoize decorator from get_price_at and _get_price_from_cost in models - caching results of this function causes wrong unit tests results - it's totally ok to use this in "normal" application, but whe should consider a solution which will not break unit tests.

I've also removed warehouse reference from UsageType - there is no need to keep it here - and changed select list in report form - it's using ModelChoiceField now (simple ChoiceField with filling items from Warehouse model "by hand" breaks unit tests (missing db table)).

Last but not least - i've improved some unit tests - mainly especially assets and report by ventures - now every test works.

Consider merging it into your branch, then check if everything is ok (pep8 etc), then update your pull request to ralph_pricing.

TODO: add unit test to reports generating with different warehouse choice and test if forecast report is working.