From 514c5c9bbbd4979625a15db54e3549079e1ded9c Mon Sep 17 00:00:00 2001 From: Artur Barseghyan Date: Tue, 12 Dec 2023 21:33:25 +0100 Subject: [PATCH] More --- fake.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/fake.py b/fake.py index e90e0e9..610ae1d 100644 --- a/fake.py +++ b/fake.py @@ -1738,7 +1738,10 @@ def faker(self, value): def _add_provider_methods(self, faker_instance): for class_name, methods in PROVIDER_REGISTRY.items(): - if class_name == "fake.Faker" or class_name == self.faker.uid: + if ( + class_name == f"{__name__}.{Faker.__name__}" + or class_name == self.faker.uid + ): for method_name in methods: if hasattr(faker_instance, method_name): bound_method = create_factory_method(method_name) @@ -2709,7 +2712,7 @@ def test_faker_init(self) -> None: self.assertNotEqual(faker.alias, "default") def test_get_by_uid(self) -> None: - faker = Faker.get_by_uid(f"{__name__}.Faker") + faker = Faker.get_by_uid(f"{__name__}.{Faker.__name__}") self.assertIs(faker, self.faker) def test_get_by_alias(self) -> None: