mirror of
https://github.com/danieleteti/delphimvcframework.git
synced 2024-11-15 07:45:54 +01:00
Fixed a unit test related to JWT
This commit is contained in:
parent
6ac9590618
commit
cae2e4e088
3
tasks.py
3
tasks.py
@ -12,7 +12,7 @@ from pathlib import Path
|
||||
|
||||
init()
|
||||
|
||||
DEFAULT_DELPHI_VERSION = "11.2"
|
||||
DEFAULT_DELPHI_VERSION = "11.3"
|
||||
|
||||
g_releases_path = "releases"
|
||||
g_output = "bin"
|
||||
@ -53,6 +53,7 @@ def build_delphi_project(
|
||||
"11": {"path": "22.0", "desc": "Delphi 11 Alexandria"},
|
||||
"11.1": {"path": "22.0", "desc": "Delphi 11.1 Alexandria"},
|
||||
"11.2": {"path": "22.0", "desc": "Delphi 11.2 Alexandria"},
|
||||
"11.3": {"path": "22.0", "desc": "Delphi 11.3 Alexandria"},
|
||||
}
|
||||
|
||||
assert delphi_version in delphi_versions, (
|
||||
|
@ -1613,12 +1613,14 @@ var
|
||||
lToken: string;
|
||||
lJWT: TJWT;
|
||||
lError: string;
|
||||
lExp: TDateTime;
|
||||
begin
|
||||
lExp := Now + OneHour * 2;
|
||||
FJWT.Claims.Issuer := 'bit Time Professionals';
|
||||
FJWT.Claims.Subject := 'DelphiMVCFramework';
|
||||
FJWT.Claims.Audience := 'DelphiDevelopers';
|
||||
FJWT.Claims.IssuedAt := EncodeDateTime(2011, 11, 17, 17, 30, 0, 0);
|
||||
FJWT.Claims.ExpirationTime := Now + OneHour * 2;
|
||||
FJWT.Claims.ExpirationTime := lExp;
|
||||
FJWT.Claims.NotBefore := EncodeDateTime(2011, 11, 17, 17, 30, 0, 0);
|
||||
FJWT.Claims.JWT_ID := '123456';
|
||||
FJWT.CustomClaims['username'] := 'dteti';
|
||||
@ -1635,7 +1637,7 @@ begin
|
||||
Assert.areEqual('DelphiDevelopers', lJWT.Claims.Audience);
|
||||
Assert.areEqual('123456', lJWT.Claims.JWT_ID);
|
||||
Assert.areEqual(EncodeDateTime(2011, 11, 17, 17, 30, 0, 0), lJWT.Claims.IssuedAt);
|
||||
Assert.areEqual(Roundto(lJWT.Claims.IssuedAt + OneHour * 2, 4), Roundto(lJWT.Claims.ExpirationTime, 4));
|
||||
Assert.areEqual(Roundto(lExp, 4), Roundto(lJWT.Claims.ExpirationTime, 4));
|
||||
Assert.areEqual(EncodeDateTime(2011, 11, 17, 17, 30, 0, 0), lJWT.Claims.NotBefore);
|
||||
Assert.areEqual('dteti', lJWT.CustomClaims['username']);
|
||||
Assert.areEqual('admin', lJWT.CustomClaims['userrole']);
|
||||
|
Loading…
Reference in New Issue
Block a user