File tree Expand file tree Collapse file tree 1 file changed +2
-13
lines changed Expand file tree Collapse file tree 1 file changed +2
-13
lines changed Original file line number Diff line number Diff line change 1
- from typing import Generic , TypeVar
2
-
3
1
import factory
4
2
import waffle
5
3
from django .contrib .auth import get_user_model
6
4
7
- T = TypeVar ("T" )
8
5
FlagModel = waffle .get_waffle_flag_model ()
9
6
UserModel = get_user_model ()
10
7
11
8
12
- class BaseFactory (Generic [T ], factory .django .DjangoModelFactory ):
13
- """This is a workaround to get type hints to play nice with factory boy."""
14
-
15
- @classmethod
16
- def create (cls , ** kwargs ) -> T :
17
- return super ().create (** kwargs )
18
-
19
-
20
- class FlagFactory (BaseFactory [FlagModel ]):
9
+ class FlagFactory (factory .django .DjangoModelFactory ):
21
10
class Meta :
22
11
model = FlagModel
23
12
24
13
25
- class UserFactory (BaseFactory [ UserModel ] ):
14
+ class UserFactory (factory . django . DjangoModelFactory ):
26
15
class Meta :
27
16
model = UserModel
You can’t perform that action at this time.
0 commit comments