| Conditions | 3 |
| Total Lines | 11 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | # -*- coding: utf-8 -*- |
||
| 28 | def login( |
||
| 29 | self, user=None, |
||
| 30 | backend="django.contrib.auth.backends.ModelBackend", |
||
| 31 | **credentials): |
||
| 32 | if user is None: |
||
| 33 | return super(_Client, self).login(**credentials) |
||
| 34 | |||
| 35 | with mock.patch('django.contrib.auth.authenticate') as authenticate: |
||
| 36 | user.backend = backend |
||
| 37 | authenticate.return_value = user |
||
| 38 | return super(_Client, self).login(**credentials) |
||
| 39 | |||
| 58 |