Skip to content

Commit

Permalink
fixed validation and test
Browse files Browse the repository at this point in the history
  • Loading branch information
DevDaveFrame committed Nov 29, 2023
1 parent abcdb92 commit b6d8a01
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion bigquery_exporter/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ def custom_field(method):
Decorator to mark a method as a custom field for a BigQueryExporter subclass.
"""
# Ensure that the method has exactly two arguments: self and the Django model instance
assert method.__code__.co_argcount != 2, \
assert method.__code__.co_argcount == 2, \
'Custom field methods must have exactly two arguments: self and the Django model instance'
method.is_custom_field = True
return method
Expand Down
2 changes: 1 addition & 1 deletion tests/test_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ def test_export_logs_error_on_exception(self, test_exporter, caplog):

def test_custom_field_decorator_sets_custom_attribute_on_callable(self):
@custom_field
def test_field():
def test_field(self, obj):
pass

assert test_field.is_custom_field
Expand Down

0 comments on commit b6d8a01

Please sign in to comment.