Passed
Pull Request — master (#227)
by Piotr
01:07
created

UserEmailFactoryBaseTest   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 14
Duplicated Lines 0 %

Importance

Changes 2
Bugs 0 Features 0
Metric Value
wmc 1
c 2
b 0
f 0
dl 0
loc 14
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A TestDjoserViewsSupportActionAttribute.test_action_reflect_http_method() 0 10 2
1
from djet import restframework
0 ignored issues
show
Coding Style introduced by
This module should have a docstring.

The coding style of this project requires that you add a docstring to this code element. Below, you find an example for methods:

class SomeClass:
    def some_method(self):
        """Do x and return foo."""

If you would like to know more about docstrings, we recommend to read PEP-257: Docstring Conventions.

Loading history...
introduced by
Unable to import 'djet'
Loading history...
2
from rest_framework.request import Request, override_method
0 ignored issues
show
introduced by
Unable to import 'rest_framework.request'
Loading history...
3
4
import djoser.constants
5
import djoser.serializers
6
import djoser.signals
7
import djoser.utils
8
import djoser.views
9
10
11
class TestDjoserViewsSupportActionAttribute(restframework.APIViewTestCase):
0 ignored issues
show
Coding Style introduced by
This class should have a docstring.

The coding style of this project requires that you add a docstring to this code element. Below, you find an example for methods:

class SomeClass:
    def some_method(self):
        """Do x and return foo."""

If you would like to know more about docstrings, we recommend to read PEP-257: Docstring Conventions.

Loading history...
12
    # any arbitrary view from djoser
13
    view_class = djoser.views.UserView
14
15
    def test_action_reflect_http_method(self):
0 ignored issues
show
Coding Style introduced by
This method should have a docstring.

The coding style of this project requires that you add a docstring to this code element. Below, you find an example for methods:

class SomeClass:
    def some_method(self):
        """Do x and return foo."""

If you would like to know more about docstrings, we recommend to read PEP-257: Docstring Conventions.

Loading history...
16
        request = self.factory.get()
17
18
        view = self.view_class()
19
        view.action_map = {'get': 'retrieve'}
20
21
        # reproduce DRF wrapping
22
        with override_method(view, Request(request), 'GET') as request:
23
            view.dispatch(request)
24
            self.assertEqual(view.action, 'retrieve')
25