# Path: bugsnag/breadcrumbs.py
# class BreadcrumbType(Enum):
#     NAVIGATION = 'navigation'
#     REQUEST = 'request'
#     PROCESS = 'process'
#     LOG = 'log'
#     USER = 'user'
#     STATE = 'state'
#     ERROR = 'error'
#     MANUAL = 'manual'
# 
# Path: tests/utils.py
# class MissingRequestError(Exception):
#     pass


import bugsnag
import pytest
import django
from bugsnag.breadcrumbs import BreadcrumbType
from django.contrib.auth.models import User
from django.test import Client
    from django.template.exceptions import TemplateSyntaxError
    from django.template.base import TemplateSyntaxError
from django.conf import settings
from tests.utils import MissingRequestError
        'encoding': None,
        'GET': {'foo': ['strawberry']}
    }
    assert event['user'] == {}
    assert exception['errorClass'] == 'KeyError'
    assert exception['message'] == "'nonexistent-item'"
    assert exception['stacktrace'][0] == {
        'code': {
             '39': 'def handle_notify(request):',
             '40': '    items = {}',
             '41': '    try:',
             '42': '        print("item: {}" % items["nonexistent-item"])',
             '43': '    except KeyError as e:',
             '44': "        bugsnag.notify(e, unhappy='nonexistent-file')",
             '45': '',
        },
        'file': 'notes/views.py',
        'inProject': True,
        'lineNumber': 42,
        'method': 'handle_notify',
    }

    breadcrumbs = payload['events'][0]['breadcrumbs']

    assert len(breadcrumbs) == 1
    assert breadcrumbs[0]['name'] == 'http request'
    assert breadcrumbs[0]['metaData'] == {
        'to': '/notes/handled-exception/',
        'from': 'http://testserver/notes/top-10-dogs.txt'
    }

# Path: bugsnag/breadcrumbs.py
# class BreadcrumbType(Enum):
#     NAVIGATION = 'navigation'
#     REQUEST = 'request'
#     PROCESS = 'process'
#     LOG = 'log'
#     USER = 'user'
#     STATE = 'state'
#     ERROR = 'error'
#     MANUAL = 'manual'
# 
# Path: tests/utils.py
# class MissingRequestError(Exception):
#     pass


# Path: tests/integrations/test_django.py
import bugsnag
import pytest
import django
from bugsnag.breadcrumbs import BreadcrumbType
from django.contrib.auth.models import User
from django.test import Client
    from django.template.exceptions import TemplateSyntaxError
    from django.template.base import TemplateSyntaxError
from django.conf import settings
from tests.utils import MissingRequestError

        'encoding': None,
        'GET': {'foo': ['strawberry']}
    }
    assert event['user'] == {}
    assert exception['errorClass'] == 'KeyError'
    assert exception['message'] == "'nonexistent-item'"
    assert exception['stacktrace'][0] == {
        'code': {
             '39': 'def handle_notify(request):',
             '40': '    items = {}',
             '41': '    try:',
             '42': '        print("item: {}" % items["nonexistent-item"])',
             '43': '    except KeyError as e:',
             '44': "        bugsnag.notify(e, unhappy='nonexistent-file')",
             '45': '',
        },
        'file': 'notes/views.py',
        'inProject': True,
        'lineNumber': 42,
        'method': 'handle_notify',
    }

    breadcrumbs = payload['events'][0]['breadcrumbs']

    assert len(breadcrumbs) == 1
    assert breadcrumbs[0]['name'] == 'http request'
    assert breadcrumbs[0]['metaData'] == {
        'to': '/notes/handled-exception/',
        'from': 'http://testserver/notes/top-10-dogs.txt'
    }

    assert breadcrumbs[0]['type'] == BreadcrumbType.NAVIGATION.value