Skip to content

Commit

Permalink
tests: add missing contribute_to_class to fully instanciate the field
Browse files Browse the repository at this point in the history
  • Loading branch information
dzen committed Apr 7, 2021
1 parent fe10c5e commit eae21d3
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions ldapdb/tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ class WhereTestCase(TestCase):
def _build_lookup(self, field_name, lookup, value, field=fields.CharField):
fake_field = field()
fake_field.set_attributes_from_name(field_name)
fake_field.contribute_to_class(FakeModel, "fake")
lhs = expressions.Col('faketable', fake_field, fake_field)
lookup = lhs.get_lookup(lookup)
return lookup(lhs, value)
Expand Down

0 comments on commit eae21d3

Please sign in to comment.