Update CLI test_user

Use stubbed decorator instead of unittest.skip decorator to avoid the
need of handling the unittest import.

Wrap all factories call with a try/except block.

Update test_negative_delete_user_1 because now make_user factory does
not return the password.

Use unicode when searching for a user as the login may contain unicode
characters.
Merge pull request #1616 from elyezer/update-cli-test-user

Update CLI test_user
Skip fix_db_cache settings test due to a bug

Due to http://projects.theforeman.org/issues/8053 foreman-tasks are
being killed and if the fix_db_cache setting is true foreman-tasks does
not start and make the system not behave as expected.
Make ActivationKey.read_json poll upon getting 404

Make method `ActivationKey.read_json` poll the server up to five additional
times upon receiving an HTTP 404 response. As per an IRC conversation with
@thomasmckay, bugzilla bug 1127335 will not be fixed, and clients **must**
resort to polling the server to determine whether a 404 is valid or not.

Several tests in module `test_activationkey` fail, but due to unrelated reasons
(that should be investigated!).

    $ nosetests tests/foreman/api/test_activationkey.py
    InsecureRequestWarning)
    ......FFF...................
    ======================================================================
    …
    ----------------------------------------------------------------------
    Ran 28 tests in 86.375s

    FAILED (failures=3)

Fix the one remaining failure in module `test_multiple_paths`:

    $ nosetests tests/foreman/api/test_multiple_paths.py -m ActivationKey
    InsecureRequestWarning)
    .S....SS
    ----------------------------------------------------------------------
    Ran 8 tests in 38.545s

    OK (SKIP=3)

Fix several Jenkins failures. Target #1578.
Merge pull request #1617 from elyezer/skip-ui-settings-test

Skip fix_db_cache settings test due to a bug
Merge pull request #1618 from Ichimonji10/activation-key

Make ActivationKey.read_json poll upon getting 404
Add API content view with puppet modules tests - issue #1266
Merge pull request #1610 from alda519/api-cv-puppet

Add API content view with puppet modules tests - issue #1266
Skip failing activation-key tests

Creating an activation key with these options fails, as it should:

* max_content_hosts=-5
* max_content_hosts='ABcd37'

However, creating an activation key with these options succeed:

* unlimited_content_hosts=True, max_content_hosts=-5
* unlimited_content_hosts=True, max_content_hosts='ABcd37'
* unlimited_content_hosts=True, max_content_hosts=5

As demonstrated above, the API allows an invalid value for the
`max_content_hosts` argument when `unlimited_content_hosts` is true. When this
occurs, the `max_content_hosts` option is entirely ignored. Here's a concrete
example:

    >>> attrs = entities.ActivationKey(
    ...     max_content_hosts='ABcd37',
    ...     unlimited_content_hosts=True
    ... ).create()
    >>> for attr in ('max_content_hosts', 'unlimited_content_hosts'):
    ...     print(attrs[attr])
    ...
    None
    True

See bugzilla bug 1156555 for more information. Skip tests due to this bug:

    $ nosetests tests/foreman/api/test_activationkey.py  -m test_negative_create_3
    SSS
    ----------------------------------------------------------------------
    Ran 3 tests in 0.518s

    OK (SKIP=3)
Merge pull request #1619 from Ichimonji10/activation-key

Skip failing activation-key tests
Drop booby, let nil values be submitted to API

Drop dependency on booby.

* Make class `Entity` inherit directly from `object`. Define method
  `Entity.__init__`, and make that method handle whatever instantiation logic
  booby formerly did. (but better!)
* Make class `Field` inherit directly from `object`. Define method
  `Field.__init__`, and make that method capable of recording the instance
  attributes `required`, `choices`, `default` and `null`.

This has several positive effects. First, fewer methods are necessary.

* Drop method `robottelo.factory.field_is_required`. The `required` attribute is
  guaranteed to exist on all `Field` classes, so it is possible to just call
  `SomeField.required` instead.
* Drop method `robottelo.orm.Entity.get_values`. It is now possible to just call
  `vars(SomeEntity)` instead.

Second, all classes inheriting from `Entity` and `Field` have a more
comprehensible inheritance tree and sane instantiation process. An `update`
method is no longer inherited from booby, which means that an
`EntityUpdateMixin` may finally be created without MRO issues, and no metaclass
magic is used. Incidentally, a pylint error stating that many `Entity`
subclasses have too many ancestors is now gone.

Third, it is now possible to pass `None` values into classes. This fixes #1082.
Formerly, this behaviour was exhibited:

    >>> from robottelo.entities import Organization
    >>> for org in (
    ...         Organization(name='ACME'),
    ...         Organization(name='ACME', description=None),
    ...         Organization(name='ACME', description='Better than ACNE!')
    ... ):
    ...     org.get_values()
    ...
    {'name': 'ACME'}
    {'name': 'ACME'}
    {'description': 'Better than ACNE!', 'name': 'ACME'}

This is the new behaviour:

    >>> from robottelo.entities import Organization
    >>> for org in (
    ...         Organization(name='ACME'),
    ...         Organization(name='ACME', description=None),
    ...         Organization(name='ACME', description='Better than ACNE!')
    ... ):
    ...     vars(org)
    ...
    {'name': 'ACME'}
    {'description': None, 'name': 'ACME'}
    {'description': 'Better than ACNE!', 'name': 'ACME'}

Drop a `pylint:disable` directive from module `robottelo.entities`. All classes
inheriting from `Entity` now have an `__init__` method.

These changes do not appear to break anything. Module `test_multiple_paths` is
in good shape:

    $ python -m unittest tests.foreman.api.test_multiple_paths
    …
    ----------------------------------------------------------------------
    Ran 238 tests in 154.352s

    FAILED (failures=1, skipped=62)

The one failed test relates to activation keys, which is a known issue. `make
test-robottelo` also succeeds.
Merge pull request #1615 from Ichimonji10/experiment

Drop booby, let nil values be submitted to API
Fix/Update remaining CLI users tests

Email validation have change on foreman and all tests that checks for
email needed to be updated.

Fix test_negative_delete_user_1 to only call the factory if the login is
not provided in the test data.
Skip and improve some CLI content-view tests

Skip tests that uses the hammer content-view info output because its not
consistent with the rename of environments to
lifecycle-environments.

Also improve assertion for test_cv_promote_custom_content and
test_cv_promote_composite

Bonus: remove skip_if_bug_open for the verified BZ 1127408 related to
the repository info failure
Merge pull request #1620 from elyezer/cli-user-tests

Fix/Update remaining CLI users tests
Merge pull request #1625 from elyezer/cli-content-view

Skip and improve some CLI content-view tests
Test:Check if multiple Activation keys can be attached to a system
- added a function to fetch the associated content-host with activation-key
- updated top menu locator names
Merge pull request #1627 from sghai/ak-test

Test:Check if multiple Activation keys can be attached to a system
removed unwanted navigation for some tests.

The navigation would be taken care by the search function, which
is called upon by the update function.
Merge pull request #1628 from kbidarkar/fix-os-ui

removed unwanted navigation for some tests.