2023-06-08 12:52:25 +02:00
|
|
|
import pytest
|
|
|
|
|
|
|
|
from ee.models.property_definition import EnterprisePropertyDefinition
|
|
|
|
from posthog.test.base import BaseTest
|
|
|
|
|
|
|
|
|
|
|
|
class TestPropertyDefinition(BaseTest):
|
|
|
|
def test_errors_on_invalid_verified_by_type(self):
|
|
|
|
with pytest.raises(ValueError):
|
|
|
|
EnterprisePropertyDefinition.objects.create(
|
2023-10-26 12:38:15 +02:00
|
|
|
team=self.team,
|
|
|
|
name="enterprise property",
|
|
|
|
verified_by="Not user id", # type: ignore
|
2023-06-08 12:52:25 +02:00
|
|
|
)
|
|
|
|
|
|
|
|
def test_default_verified_false(self):
|
|
|
|
definition = EnterprisePropertyDefinition.objects.create(team=self.team, name="enterprise property")
|
|
|
|
assert definition.verified is False
|