Mastercard / flow

Testing framework

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Validate EagerModel MODEL_TAGS field

therealryan opened this issue · comments

When you register an EagerModel class with a LazyModel, we check if it has a public static TaggedGroup MODEL_TAGS field. The LazyModel instance uses that data to decide whether or not to build the LazyModel when it is asked for flows with particular tags.
We've already got validation that confirms that the TaggedGroup returned from a model instance is accurate, but we should also add validation to check that the TaggedGroup returned from a LazyModel is the same as that in the MODEL_TAGS field.
This blocks the (frankly unlikely, but let's belt-and-braces this thing) failure mode of a LazyModel implementation that has inaccurate data in MODEL_TAGS, but returns a different but accurate result from the tags() method.