omaciel/robottelo — pull request #1113 by omaciel (2014-07-30 19:21:02+00:00)
Title: Updated ActivationKey API v2 Tests.

Noticed that ``test_positive_create_3`` was failing because of some
apparent changes done to the POST method. Before, if I tried to create
an activationkey setting ``unlimited_content_hosts`` to ``True`` and
``max_content_hosts`` to a random value, valid or invalid, the
activationkey was created and ``max_content_hosts`` was ignored and set
to ``None`` (the test checked that the key was created and that
``max_content_hosts`` was ``None``).

Now it looks that if you try to do the same thing, you get a ``422``
error due to ``max_content_hosts`` being automatically set to ``Nil``.

```pycon
In[1] attrs =
entities.ActivationKey().create(
fields={u'unlimited_content_hosts': True, u'max_content_hosts': -3})

FactoryError: Error encountered while POSTing to
https://qetello02.usersys.redhat.com/katello/api/v2/activation_keys.
Error received: {u'max_content_hosts': [u'cannot be nil']}
```

I have changed this test to be a negative test and updated the
assertions appropriately.