Merge pull request #1734 from Ichimonji10/test-repository

Deduplicate test data
Update EntityDeleteMixin, change _poll_task args

Create method `EntityDeleteMixin.delete_raw`. This method is useful when a
client wishes to delete something and get the response object, which contains
information such as a status code and the raw byte response.

Make method `EntityDeleteMixin.delete` act more like other methods that deal
with foreman tasks. It now always returns a dict of data, rather than evaluating
some mildly complex logic and returning either a foreman task ID or None.

Change the arguments to the `robottelo.orm._poll_task` method. Make that method
use `None` as a default argument to several methods instead of concrete values.
This change makes it easier to override that method.

Update the unit tests for `robottelo.orm.EntityDeleteMixin.delete`.

    $ nosetests tests/robottelo/
    ......................................................................................................................................................
    ----------------------------------------------------------------------
    Ran 150 tests in 0.107s

    OK

Use method `delete_raw` instead of `client.delete`. Using `delete_raw` allows
for more compact code.

    $ nosetests tests/foreman/api/test_multiple_paths.py  -m test_delete_status_code
    ......................
    ----------------------------------------------------------------------
    Ran 22 tests in 31.614s

    OK
Merge pull request #1736 from Ichimonji10/delete-raw

Update EntityDeleteMixin, change _poll_task args
Skip tests that fail due to BZ 1166365

Deleting a repository is an asynchronous task, and there's no way to monitor the
progress of the deletion except by polling to see if that repository still
exists. This is problematic, and it's exacerbated by the fact that the task can
take a significant (10+ seconds) amount of time. When a client deletes a
repository, the server should either block until the deletion is done, or it
should return a task that can be monitored.

Here's a simple script that I've used to test this issue (it depends on some robottelo code):

    #!/usr/bin/env python2
    from robottelo.entities import Repository
    from time import sleep
    repo_id = Repository().create_json()['id']
    repo = Repository(id=repo_id)
    print('Target: 200, actual: {0}'.format(repo.read_raw().status_code))
    repo.delete()
    print('Target: 404, actual: {0}'.format(repo.read_raw().status_code))
    sleep(10)
    print('Target: 404, actual: {0}'.format(repo.read_raw().status_code))

And here's some output I've received:

    Target: 200, actual: 200
    Target: 404, actual: 200
    Target: 404, actual: 500