Skip to content

Commit

Permalink
[#1218] Fix wrong test
Browse files Browse the repository at this point in the history
  • Loading branch information
amercader committed Nov 25, 2013
1 parent f4132ce commit cd580c6
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions ckan/tests/functional/api/test_activity.py
Expand Up @@ -573,17 +573,17 @@ def _update_extra(self, package_dict, user):
[group['name'] for group in package_dict['groups']],
apikey=apikey)

extras_before = package_dict['extras']
import copy
extras_before = copy.deepcopy(package_dict['extras'])
assert len(extras_before) > 0, (
"Can't update an extra if the package doesn't have any")

# Update the package's first extra.
extras = list(extras_before)
if extras[0]['value'] != '"edited"':
extras[0]['value'] = '"edited"'
if package_dict['extras'][0]['value'] != '"edited"':
package_dict['extras'][0]['value'] = '"edited"'
else:
assert extras[0]['value'] != '"edited again"'
extras[0]['value'] = '"edited again"'
assert package_dict['extras'][0]['value'] != '"edited again"'
package_dict['extras'][0]['value'] = '"edited again"'
updated_package = package_update(self.app, package_dict,
user['apikey'])

Expand Down

0 comments on commit cd580c6

Please sign in to comment.