factories.py

Last source

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
"""Module defining factories for the Namespace code_repository entity."""

import factory

from faker_enum import EnumProvider

from isshub.domain.contexts.code_repository.entities.namespace import (
    Namespace,
    NamespaceKind,
)


factory.Faker.add_provider(EnumProvider)


class NamespaceFactory(factory.Factory):
    """Factory for the ``Namespace`` code_repository entity."""

    class Meta:
        """Factory config."""

        model = Namespace

    identifier = factory.Faker("uuid4", cast_to=None)
    name = factory.Faker("pystr", min_chars=2)
    kind = factory.Faker("enum", enum_cls=NamespaceKind)

Changes

fix(entity): id changed from int to uuid4, renamed to identifier

Commit
Hash

79f704bde4575a9ddeb623d67d8965a62138adc9

Date

2020-10-05 10:51:49 +0200

Type

Modified

Stats

+1 -1

@@ -21,6 +21,6 @@ class NamespaceFactory(factory.Factory):

         model = Namespace

-    id = factory.Faker("pyint", min_value=1)
+    identifier = factory.Faker("uuid4", cast_to=None)
     name = factory.Faker("pystr", min_chars=2)
     kind = factory.Faker("enum", enum_cls=NamespaceKind)

refactor(core): Rename core domain context to code_repository

Commit
Hash

07e279b370c0924f2b2cf32aea016b307001dfa0

Date

2019-08-15 23:31:33 +0200

Type

Renamed

Old path

isshub/domain/contexts/core/entities/namespace/tests/factories.py

Stats

+6 -3

@@ -1,17 +1,20 @@
-"""Module defining factories for the Namespace core entity."""
+"""Module defining factories for the Namespace code_repository entity."""

 import factory

 from faker_enum import EnumProvider

-from isshub.domain.contexts.core.entities.namespace import Namespace, NamespaceKind
+from isshub.domain.contexts.code_repository.entities.namespace import (
+    Namespace,
+    NamespaceKind,
+)


 factory.Faker.add_provider(EnumProvider)


 class NamespaceFactory(factory.Factory):
-    """Factory for the ``Namespace`` core entity."""
+    """Factory for the ``Namespace`` code_repository entity."""

     class Meta:
         """Factory config."""