File tree Expand file tree Collapse file tree 5 files changed +2120
-1991
lines changed Expand file tree Collapse file tree 5 files changed +2120
-1991
lines changed Original file line number Diff line number Diff line change @@ -10,6 +10,8 @@ follows `Semantic versioning`_
10
10
Development version
11
11
-------------------
12
12
- Add ``FactoryAggregate `` provider.
13
+ - Add ``Provider.provider `` dynamic attribute that return new provider's
14
+ delegate (alias of method ``Provider.delegate() ``).
13
15
- Add support of six 1.11.0.
14
16
- Regenerate C sources using Cython 0.27.1.
15
17
Original file line number Diff line number Diff line change @@ -51,3 +51,18 @@ def main_photo(self):
51
51
# Making some asserts:
52
52
assert isinstance (user1 .main_photo , Photo )
53
53
assert isinstance (user2 .main_photo , Photo )
54
+
55
+ # or using Factory(...).provider
56
+
57
+ photos_factory = providers .Factory (Photo )
58
+ users_factory = providers .Factory (User ,
59
+ photos_factory = photos_factory .provider )
60
+
61
+
62
+ # Creating several User objects:
63
+ user1 = users_factory () # Same as: user1 = User(photos_factory=photos_factory)
64
+ user2 = users_factory () # Same as: user2 = User(photos_factory=photos_factory)
65
+
66
+ # Making some asserts:
67
+ assert isinstance (user1 .main_photo , Photo )
68
+ assert isinstance (user2 .main_photo , Photo )
You can’t perform that action at this time.
0 commit comments