Skip to content

Commit

Permalink
fix: tests
Browse files Browse the repository at this point in the history
  • Loading branch information
irtazaakram authored and Feanil Patel committed Apr 5, 2024
1 parent 5248901 commit c14cc41
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions tests/test_xblock_services.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,8 @@ def test_field_data_get(self):
assert date == self.items[0][1]['due']

# non-date
dfd.get(block, b'foo')
assert defaults.get.called_once_with(block.location, 'foo')
dfd.get(block, 'foo')
defaults.get.assert_called_once_with(block, 'foo')

# non-existent value
defaults.has.return_value = False
Expand Down Expand Up @@ -100,9 +100,9 @@ def test_field_data_set_delete(self):
defaults = mock.MagicMock()
dfd = field_data.DateLookupFieldData(defaults, course_id=self.course_id, use_cached=False, user=self.user)
dfd.set('foo', 'bar', 'x')
assert defaults.called_once_with('foo', 'bar', 'x')
defaults.set.assert_called_once_with('foo', 'bar', 'x')
dfd.delete('baz', 'boing')
assert defaults.called_once_with('baz', 'boing')
defaults.delete.assert_called_once_with('baz', 'boing')

def test_wrapped_fielddata(self):
defaults = mock.MagicMock()
Expand All @@ -122,7 +122,7 @@ def test_name(self):
def test_collect(self):
block_structure = mock.MagicMock()
field_data.DateOverrideTransformer.collect(block_structure)
assert block_structure.request_xblock_fields.called_once_with('due', 'start')
block_structure.request_xblock_fields.assert_called_once_with('due', 'start', 'end')

@mock.patch('edx_when.api._are_relative_dates_enabled', return_value=True)
def test_transform(self, _mock):
Expand Down

0 comments on commit c14cc41

Please sign in to comment.