@@ -121,17 +121,14 @@ def test_set_secure_httponly_attrs(self):
121
121
self .assertEqual (C .output (),
122
122
'Set-Cookie: Customer="WILE_E_COYOTE"; HttpOnly; Secure' )
123
123
124
- def test_samesite_strict_attrs (self ):
125
- C = cookies .SimpleCookie ('Customer="WILE_E_COYOTE"' )
126
- C ['Customer' ]['samesite' ] = "Strict"
127
- self .assertEqual (C .output (),
128
- 'Set-Cookie: Customer="WILE_E_COYOTE"; SameSite=Strict' )
129
-
130
- def test_samesite_lax_attrs (self ):
131
- C = cookies .SimpleCookie ('Customer="WILE_E_COYOTE"' )
132
- C ['Customer' ]['samesite' ] = "Lax"
133
- self .assertEqual (C .output (),
134
- 'Set-Cookie: Customer="WILE_E_COYOTE"; SameSite=Lax' )
124
+ def test_samesite_attrs (self ):
125
+ samesite_values = ("Strict" , "Lax" )
126
+ for val in samesite_values :
127
+ with self .subTest (val = val ):
128
+ C = cookies .SimpleCookie ('Customer="WILE_E_COYOTE"' )
129
+ C ['Customer' ]['samesite' ] = val
130
+ self .assertEqual (C .output (),
131
+ 'Set-Cookie: Customer="WILE_E_COYOTE"; SameSite=%s' % val )
135
132
136
133
def test_secure_httponly_false_if_not_present (self ):
137
134
C = cookies .SimpleCookie ()
0 commit comments