Repository: nephila/python-taiga
Pull request #83 (2019-04-13 10:49:01)

Update test_list_milestones to test extra query parameters

codecov[bot]: # [Codecov](https://codecov.io/gh/nephila/python-taiga/pull/83?src=pr&el=h1) Report
> Merging [#83](https://codecov.io/gh/nephila/python-taiga/pull/83?src=pr&el=desc) into [master](https://codecov.io/gh/nephila/python-taiga/commit/e2f0de99c27c8f54f49ce5e2965eeb16af1c0b12?src=pr&el=desc) will **not change** coverage.
> The diff coverage is `n/a`.

[![Impacted file tree graph](https://codecov.io/gh/nephila/python-taiga/pull/83/graphs/tree.svg?width=650&token=6FY1d0GEVv&height=150&src=pr)](https://codecov.io/gh/nephila/python-taiga/pull/83?src=pr&el=tree)

```diff
@@           Coverage Diff           @@
##           master      #83   +/-   ##
=======================================
  Coverage   97.48%   97.48%           
=======================================
  Files           7        7           
  Lines         835      835           
  Branches       69       69           
=======================================
  Hits          814      814           
  Misses          8        8           
  Partials       13       13
```


| [Impacted Files](https://codecov.io/gh/nephila/python-taiga/pull/83?src=pr&el=tree) | Coverage Δ | |
|---|---|---|
| [taiga/models/models.py](https://codecov.io/gh/nephila/python-taiga/pull/83/diff?src=pr&el=tree#diff-dGFpZ2EvbW9kZWxzL21vZGVscy5weQ==) | `98.68% <ø> (ø)` | :arrow_up: |

------

[Continue to review full report at Codecov](https://codecov.io/gh/nephila/python-taiga/pull/83?src=pr&el=continue).
> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
> Powered by [Codecov](https://codecov.io/gh/nephila/python-taiga/pull/83?src=pr&el=footer). Last update [e2f0de9...183756d](https://codecov.io/gh/nephila/python-taiga/pull/83?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).

codecov[bot]: # [Codecov](https://codecov.io/gh/nephila/python-taiga/pull/83?src=pr&el=h1) Report
> Merging [#83](https://codecov.io/gh/nephila/python-taiga/pull/83?src=pr&el=desc) into [master](https://codecov.io/gh/nephila/python-taiga/commit/e2f0de99c27c8f54f49ce5e2965eeb16af1c0b12?src=pr&el=desc) will **not change** coverage.
> The diff coverage is `n/a`.

[![Impacted file tree graph](https://codecov.io/gh/nephila/python-taiga/pull/83/graphs/tree.svg?width=650&token=6FY1d0GEVv&height=150&src=pr)](https://codecov.io/gh/nephila/python-taiga/pull/83?src=pr&el=tree)

```diff
@@           Coverage Diff           @@
##           master      #83   +/-   ##
=======================================
  Coverage   97.48%   97.48%           
=======================================
  Files           7        7           
  Lines         835      835           
  Branches       69       69           
=======================================
  Hits          814      814           
  Misses          8        8           
  Partials       13       13
```


| [Impacted Files](https://codecov.io/gh/nephila/python-taiga/pull/83?src=pr&el=tree) | Coverage Δ | |
|---|---|---|
| [taiga/models/models.py](https://codecov.io/gh/nephila/python-taiga/pull/83/diff?src=pr&el=tree#diff-dGFpZ2EvbW9kZWxzL21vZGVscy5weQ==) | `98.68% <ø> (ø)` | :arrow_up: |

------

[Continue to review full report at Codecov](https://codecov.io/gh/nephila/python-taiga/pull/83?src=pr&el=continue).
> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
> Powered by [Codecov](https://codecov.io/gh/nephila/python-taiga/pull/83?src=pr&el=footer). Last update [e2f0de9...183756d](https://codecov.io/gh/nephila/python-taiga/pull/83?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).

coveralls: 
[![Coverage Status](https://coveralls.io/builds/22787606/badge)](https://coveralls.io/builds/22787606)

Coverage remained the same at 97.622% when pulling **183756d9fb1936f22e8a34597585c8d4651533bb on morlandi:parameters** into **e2f0de99c27c8f54f49ce5e2965eeb16af1c0b12 on nephila:master**.


Patch:
diff --git a/taiga/models/base.py b/taiga/models/base.py
index cd6b4eb..90fa1d0 100644
--- a/taiga/models/base.py
+++ b/taiga/models/base.py
@@ -232,7 +232,10 @@ class InstanceResource(Resource):
         return cls(requester, **entry)
 
     def __repr__(self):
-        return '{0}({1})'.format(self.__class__.__name__, self.id)
+        try:
+            return '{0}({1})'.format(self.__class__.__name__, self.id)
+        except AttributeError:
+            return '{0}({1})'.format(self.__class__.__name__, id(self))
 
     def __str__(self):
         return self._rp()


Test patch:
diff --git a/tests/test_history.py b/tests/test_history.py
index 175000b..3ebb1f8 100644
--- a/tests/test_history.py
+++ b/tests/test_history.py
@@ -9,6 +9,16 @@ from .tools import MockResponse, create_mock_json
 
 class TestHistory(unittest.TestCase):
 
+    @patch('taiga.requestmaker.RequestMaker.get')
+    def test_history_repr(self, mock_requestmaker_get):
+        mock_requestmaker_get.return_value = MockResponse(
+            200,
+            create_mock_json('tests/resources/history_success.json')
+        )
+        api = TaigaAPI(token='f4k3')
+        api.history.issue.get(1)
+        self.assertTrue('History' in str(api.history))
+
     @patch('taiga.requestmaker.RequestMaker.get')
     def test_issue(self, mock_requestmaker_get):
         mock_requestmaker_get.return_value = MockResponse(