55
66class IRISDiscoverRunner (DiscoverRunner ):
77 _iris_container : IRISContainer
8+ _iris_user : str
9+ _iris_password : str
10+ _iris_namespace : str
811
912 def __init__ (self , * args , ** kwargs ):
1013 super ().__init__ (* args , ** kwargs )
1114
1215 iris_image = getattr (
1316 settings , "IRIS_IMAGE" , "intersystemsdc/iris-community:latest"
1417 )
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" )
1721 iris_name = getattr (settings , "IRIS_NAMESPACE" , "USER" )
22+ extra = {}
23+ if iris_key :
24+ extra ["license_key" ] = iris_key
1825
1926 self ._iris_container = IRISContainer (
2027 image = iris_image ,
21- username = iris_user ,
22- password = iris_password ,
28+ username = self . _iris_user ,
29+ password = self . _iris_password ,
2330 namespace = iris_name ,
31+ ** extra
2432 )
2533
2634 def _setup_container (self ):
@@ -35,6 +43,8 @@ def _setup_container(self):
3543 settings .DATABASES [database ]["PORT" ] = int (
3644 self ._iris_container .get_exposed_port (1972 )
3745 )
46+ settings .DATABASES [database ]["USER" ] = self ._iris_user
47+ settings .DATABASES [database ]["PASSWORD" ] = self ._iris_password
3848
3949 def _teardown_container (self ):
4050 self ._iris_container .stop ()
0 commit comments