Fix unit tests in CI (#895)

* use demo data rather than simple fixtures

* Remove admin creation in CI

* Adjust unit tests

* Remove token data from debug log
This commit is contained in:
Oliver authored and GitHub committed 2026-10-21 00:48:28 +11:00
1 parent 23abf50145
commit 7554bbdfa2
6 files changed
+53 -34

No files matched your search

+12 -1
View File
@@ -590,6 +590,17 @@ class InvenTreeAPI {
platform_name += "-" + (deviceInfo["systemVersion"] as String);
}
// The token endpoint depends on the server API version, which may not be
// known yet (first login), or may belong to a different server profile.
// Note: newer servers will not re-issue an existing token via the legacy endpoint
final infoResponse = await get(_makeUrl("/api/", base: userProfile.server));
if (!infoResponse.successful()) {
return infoResponse;
}
serverInfo = {...infoResponse.asMap()};
// Construct auth header from username and password
String authHeader =
"Basic " + base64Encode(utf8.encode("${username}:${password}"));
@@ -644,7 +655,7 @@ class InvenTreeAPI {
// Save the token to the user profile
userProfile.token = (data["token"] ?? "") as String;
debug("Received token from server: ${userProfile.token}");
debug("Received token from server");
await UserProfileDBManager().updateProfile(userProfile);