Skip to content

Commit

Permalink
fix new default oid test
Browse files Browse the repository at this point in the history
  • Loading branch information
signedav committed Nov 10, 2023
1 parent f3225e2 commit a007473
Showing 1 changed file with 16 additions and 4 deletions.
20 changes: 16 additions & 4 deletions tests/test_projectgen.py
Original file line number Diff line number Diff line change
Expand Up @@ -2775,7 +2775,10 @@ def test_tid_default_postgis(self):
t_ili_tid_field = fields.field(field_idx)
default_value_definition = t_ili_tid_field.defaultValueDefinition()
assert default_value_definition is not None
assert default_value_definition.expression() == "uuid('WithoutBraces')"
assert (
default_value_definition.expression()
== "'_' || uuid('WithoutBraces')"
)
if layer.name == "station":
# no default expression since it's defined in model
count += 1
Expand Down Expand Up @@ -2843,7 +2846,10 @@ def test_tid_import_geopackage(self):
t_ili_tid_field = fields.field(field_idx)
default_value_definition = t_ili_tid_field.defaultValueDefinition()
assert default_value_definition is not None
assert default_value_definition.expression() == "uuid('WithoutBraces')"
assert (
default_value_definition.expression()
== "'_' || uuid('WithoutBraces')"
)
if layer.name == "station":
# default expression even when it's defined in model (since geopackage cannot create uuids)
count += 1
Expand All @@ -2852,7 +2858,10 @@ def test_tid_import_geopackage(self):
t_ili_tid_field = fields.field(field_idx)
default_value_definition = t_ili_tid_field.defaultValueDefinition()
assert default_value_definition is not None
assert default_value_definition.expression() == "uuid('WithoutBraces')"
assert (
default_value_definition.expression()
== "'_' || uuid('WithoutBraces')"
)

# check if the layers have been considered
assert count == 2
Expand Down Expand Up @@ -2918,7 +2927,10 @@ def test_tid_import_mssql(self):
t_ili_tid_field = fields.field(field_idx)
default_value_definition = t_ili_tid_field.defaultValueDefinition()
assert default_value_definition is not None
assert default_value_definition.expression() == "uuid('WithoutBraces')"
assert (
default_value_definition.expression()
== "'_' || uuid('WithoutBraces')"
)
if layer.name == "station":
# no default expression since it's defined in model
count += 1
Expand Down

0 comments on commit a007473

Please sign in to comment.