Skip to content

Commit

Permalink
Test that non store fields are ignored
Browse files Browse the repository at this point in the history
  • Loading branch information
tmijail committed Jun 30, 2023
1 parent 4459dc9 commit a22e61e
Showing 1 changed file with 39 additions and 5 deletions.
44 changes: 39 additions & 5 deletions Odoo.query.pq
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,45 @@ shared Odoo.UnitTest =
// <Expected Value> and <Actual Value> can be a literal or let statement
facts =
{
Fact("Check that we have more than one entry in our nav table", try true, try Table.RowCount(root) > 1),
Fact("Check that we have more than one entry in our 'Tables' nav table", try true, try Table.RowCount(root{[Key="Tables"]}[Data]) > 1),
Fact("Check that we can query 'res.partner' through search_read", try true, try not Table.IsEmpty(resUser)),
Fact("Check that the schema for 'res.partner' is set", try true, try List.Distinct(Table.Column(Type.TableSchema(Value.Type(resUser)), "TypeName")) <> {"Any.Type"}),
Fact("Check that we can navigate to 'res.partner' from the nav table", try true, try not Table.IsEmpty(root{[Key="Tables"]}[Data]{[Model="res.users"]}[Data]{[Key="res.users"]}[Data]))
Fact(
"Check that we have more than one entry in our nav table",
try true,
try Table.RowCount(root) > 1
),
Fact(
"Check that we have more than one entry in our 'Tables' nav table",
try true,
try Table.RowCount(root{[Key="Tables"]}[Data]) > 1
),
Fact(
"Check that we can query 'res.partner' through search_read",
try true,
try not Table.IsEmpty(resUser)
),
Fact(
"Check that the schema for 'res.partner' is set",
try true,
try List.Distinct(Table.Column(Type.TableSchema(Value.Type(resUser)), "TypeName")) <> {"Any.Type"}
),
Fact(
"Check that we can navigate to 'res.partner' from the nav table",
try true,
try not Table.IsEmpty(root{[Key="Tables"]}[Data]{[Model="res.users"]}[Data]{[Key="res.users"]}[Data])
),
Fact(
"Check that non 'store' fields aren't queried when no fields are specified",
try true,
try not List.Contains(
Table.ColumnNames(resUser),
"__last_update")
),
Fact(
"Check that 'store' fields can be queried when specified",
try true,
try List.Contains(
Table.ColumnNames(search_read("res.partner", {}, [limit=1, fields={"__last_update"}])),
"__last_update")
)
},

report = Facts.Summarize(facts)
Expand Down

0 comments on commit a22e61e

Please sign in to comment.