The SubFactory with SelfAttribute carrying the apiclient
Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/b079723b Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/b079723b Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/b079723b Branch: refs/heads/marvin_refactor Commit: b079723b7e33ea998fa99ea4934053b347cfc602 Parents: e7ac9e6 Author: Prasanna Santhanam <[email protected]> Authored: Sun Apr 21 22:31:40 2013 +0530 Committer: Prasanna Santhanam <[email protected]> Committed: Sun Apr 21 22:31:40 2013 +0530 ---------------------------------------------------------------------- tools/marvin/marvin/factory/UserFactory.py | 5 +++-- 1 files changed, 3 insertions(+), 2 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/cloudstack/blob/b079723b/tools/marvin/marvin/factory/UserFactory.py ---------------------------------------------------------------------- diff --git a/tools/marvin/marvin/factory/UserFactory.py b/tools/marvin/marvin/factory/UserFactory.py index 45f28ff..f70089d 100644 --- a/tools/marvin/marvin/factory/UserFactory.py +++ b/tools/marvin/marvin/factory/UserFactory.py @@ -16,13 +16,14 @@ # under the License. import factory from marvin.base import User -from marvin.factory import CloudStackBaseFactory, AccountFactory +from marvin.factory.CloudStackBaseFactory import CloudStackBaseFactory +from marvin.factory.AccountFactory import AccountFactory class UserFactory(CloudStackBaseFactory): FACTORY_FOR = User.User - account = factory.SubFactory(AccountFactory).factory() + account = factory.SubFactory(AccountFactory, apiclient=factory.SelfAttribute('..apiclient')).factory() email = account.email firstname = account.firstname lastname = account.lastname
