Fix tests
parent
2f7384a76b
commit
9bba8efde9
|
@ -36,6 +36,15 @@ from . import models
|
|||
import json
|
||||
|
||||
|
||||
class UserStoryExistsValidator:
|
||||
def validate_us_id(self, attrs, source):
|
||||
value = attrs[source]
|
||||
if not models.UserStory.objects.filter(pk=value).exists():
|
||||
msg = _("There's no user story with that id")
|
||||
raise ValidationError(msg)
|
||||
return attrs
|
||||
|
||||
|
||||
class RolePointsField(serializers.WritableField):
|
||||
def to_native(self, obj):
|
||||
return {str(o.role.id): o.points.id for o in obj.all()}
|
||||
|
|
|
@ -123,7 +123,6 @@ def test_set_related_userstory(client):
|
|||
}
|
||||
client.login(user)
|
||||
response = client.json.post(url, json.dumps(data))
|
||||
print(response.data)
|
||||
assert response.status_code == 200
|
||||
assert response.data['user_stories_counts'] == {'opened': 1, 'closed': 0}
|
||||
|
||||
|
@ -144,7 +143,6 @@ def test_set_related_userstory_existing(client):
|
|||
}
|
||||
client.login(user)
|
||||
response = client.json.post(url, json.dumps(data))
|
||||
print(response.data)
|
||||
assert response.status_code == 200
|
||||
assert response.data['user_stories_counts'] == {'opened': 1, 'closed': 0}
|
||||
|
||||
|
|
Loading…
Reference in New Issue