Fix issue #368 and add tests (#369)

This commit is contained in:
Dylan Castillo 2024-01-27 23:10:03 +01:00 committed by GitHub
parent 997ed52bb6
commit dc9f1b46b2
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
10 changed files with 106 additions and 9 deletions

View file

@ -1,4 +1,5 @@
import difflib
import inspect
from collections import ChainMap
from typing import Any, ClassVar, Dict, Iterable, Optional, Set, Tuple, Union
@ -87,10 +88,8 @@ class Component(View, metaclass=SimplifiedInterfaceMediaDefiningClass):
self.outer_context: Context = outer_context or Context()
self.fill_content = fill_content
@classmethod
@property
def class_hash(cls):
return hash(str(cls.__module__) + str(cls.__name__))
def __init_subclass__(cls, **kwargs):
cls.class_hash = hash(inspect.getfile(cls) + cls.__name__)
def get_context_data(self, *args, **kwargs) -> Dict[str, Any]:
return {}