Coverage for benefits/enrollment_switchio/migrations/0005_switchioconfig_delete_oldswitchioconfig.py: 100%

7 statements  

« prev     ^ index     » next       coverage.py v7.10.2, created at 2025-08-08 16:26 +0000

1# Generated by Django 5.1.7 on 2025-07-14 10:20 

2 

3import benefits.core.models.common 

4import benefits.secrets 

5import django.db.models.deletion 

6from django.db import migrations, models 

7 

8 

9class Migration(migrations.Migration): 

10 

11 dependencies = [ 

12 ("core", "0056_remove_transitagency_switchio_config"), 

13 ("enrollment_switchio", "0004_rename_switchioconfig_oldswitchioconfig"), 

14 ] 

15 

16 operations = [ 

17 migrations.CreateModel( 

18 name="SwitchioConfig", 

19 fields=[ 

20 ( 

21 "transitprocessorconfig_ptr", 

22 models.OneToOneField( 

23 auto_created=True, 

24 on_delete=django.db.models.deletion.CASCADE, 

25 parent_link=True, 

26 primary_key=True, 

27 serialize=False, 

28 to="core.transitprocessorconfig", 

29 ), 

30 ), 

31 ( 

32 "tokenization_api_key", 

33 models.TextField( 

34 blank=True, default="", help_text="The API key used to access the Switchio API for tokenization." 

35 ), 

36 ), 

37 ( 

38 "tokenization_api_secret_name", 

39 benefits.core.models.common.SecretNameField( 

40 blank=True, 

41 default="", 

42 help_text="The name of the secret containing the api_secret value used to access the Switchio API for tokenization.", # noqa 

43 max_length=127, 

44 validators=[benefits.secrets.SecretNameValidator()], 

45 ), 

46 ), 

47 ( 

48 "enrollment_api_authorization_header", 

49 models.TextField( 

50 blank=True, 

51 default="", 

52 help_text="The value to use for the 'Authorization' header when accessing the Switchio API for enrollment.", # noqa 

53 ), 

54 ), 

55 ( 

56 "pto_id", 

57 models.PositiveIntegerField( 

58 blank=True, 

59 default=0, 

60 help_text="The Public Transport Operator ID to use with the Switchio API for enrollment.", 

61 ), 

62 ), 

63 ( 

64 "ca_certificate", 

65 models.ForeignKey( 

66 blank=True, 

67 default=None, 

68 help_text="The CA certificate chain for accessing the Switchio API.", 

69 null=True, 

70 on_delete=django.db.models.deletion.PROTECT, 

71 related_name="+", 

72 to="core.pemdata", 

73 ), 

74 ), 

75 ( 

76 "client_certificate", 

77 models.ForeignKey( 

78 blank=True, 

79 default=None, 

80 help_text="The client certificate for accessing the Switchio API.", 

81 null=True, 

82 on_delete=django.db.models.deletion.PROTECT, 

83 related_name="+", 

84 to="core.pemdata", 

85 ), 

86 ), 

87 ( 

88 "private_key", 

89 models.ForeignKey( 

90 blank=True, 

91 default=None, 

92 help_text="The private key for accessing the Switchio API.", 

93 null=True, 

94 on_delete=django.db.models.deletion.PROTECT, 

95 related_name="+", 

96 to="core.pemdata", 

97 ), 

98 ), 

99 ], 

100 bases=("core.transitprocessorconfig",), 

101 ), 

102 migrations.DeleteModel( 

103 name="OldSwitchioConfig", 

104 ), 

105 ]