def test_create_user_story_attachment_without_file(client):
 us = f.UserStoryFactory.create()
 f.MembershipFactory(project=us.project, user=us.owner, is_admin=True)
 attachment_data = {'description': 'test', 'attached_file': None, 'project': us.project_id}
 url = reverse('userstory-attachments-list')
 client.login(us.owner)
 response = client.post(url, attachment_data)
 assert (response.status_code == 400)

def test_create_user_story_attachment_without_file ( client ) : us = f . UserStoryFactory . create ( ) f . MembershipFactory ( project = us . project , user = us . owner , is_admin = True ) attachment_data = { 'description' : 'test' , 'attached_file' : None , 'project' : us . project_id } url = reverse ( 'userstory-attachments-list' ) client . login ( us . owner ) response = client . post ( url , attachment_data ) assert ( response . status_code == 400 )
bug test "dont create attachments without attached_file" .