5
5
6
6
class IRISDiscoverRunner (DiscoverRunner ):
7
7
_iris_container : IRISContainer
8
+ _iris_user : str
9
+ _iris_password : str
10
+ _iris_namespace : str
8
11
9
12
def __init__ (self , * args , ** kwargs ):
10
13
super ().__init__ (* args , ** kwargs )
11
14
12
15
iris_image = getattr (
13
16
settings , "IRIS_IMAGE" , "intersystemsdc/iris-community:latest"
14
17
)
15
- iris_user = getattr (settings , "IRIS_USERNAME" , "_SYSTEM" )
16
- iris_password = getattr (settings , "IRIS_PASSWORD" , "SYS" )
18
+ iris_key = getattr (settings , "IRIS_KEY" , None )
19
+ self ._iris_user = getattr (settings , "IRIS_USERNAME" , "DJANGO" )
20
+ self ._iris_password = getattr (settings , "IRIS_PASSWORD" , "django" )
17
21
iris_name = getattr (settings , "IRIS_NAMESPACE" , "USER" )
22
+ extra = {}
23
+ if iris_key :
24
+ extra ["license_key" ] = iris_key
18
25
19
26
self ._iris_container = IRISContainer (
20
27
image = iris_image ,
21
- username = iris_user ,
22
- password = iris_password ,
28
+ username = self . _iris_user ,
29
+ password = self . _iris_password ,
23
30
namespace = iris_name ,
31
+ ** extra
24
32
)
25
33
26
34
def _setup_container (self ):
@@ -35,6 +43,8 @@ def _setup_container(self):
35
43
settings .DATABASES [database ]["PORT" ] = int (
36
44
self ._iris_container .get_exposed_port (1972 )
37
45
)
46
+ settings .DATABASES [database ]["USER" ] = self ._iris_user
47
+ settings .DATABASES [database ]["PASSWORD" ] = self ._iris_password
38
48
39
49
def _teardown_container (self ):
40
50
self ._iris_container .stop ()
0 commit comments