<commit_before>#! /usr/bin/env python

from rest_framework.test import APITestCase
from rest_framework.test import APIClient

from rest_framework import status
from rest_framework.authtoken.models import Token

from django.contrib.auth.models import User
from django.core.management import call_command


class TestProvider(APITestCase):
    """ test item creation with providers """

    def setUp(self):
        user = User.objects.create_user(username='john',
                                        password='<PASSWORD>')
        token = Token.objects.get(user=user)
        call_command('timeside-create-boilerplate')
        self.client = APIClient()
        self.client.credentials(HTTP_AUTHORIZATION='Token ' + token.key)
        request_providers = self.client.get('/timeside/api/providers/', format='json')
        for provider in request_providers.data:
            if provider['pid'] == 'youtube':
                self.youtube_uuid = provider['uuid']
            if provider['pid'] == 'deezer':
                self.deezer_uuid = provider['uuid']
        
    def testProviderYoutubeFromURI(self):
        """ test item creation with youtube's MJ 'Beat It' track's URI """

        params = {'title':'Beat It',
                'description':'Music from <NAME>',<commit_msg>add provider test<commit_after>#! /usr/bin/env python

from timeside.server.tests.timeside_test_server import TimeSideTestServer
from rest_framework import status


class TestProvider(TimeSideTestServer):
    """ test item creation with providers """

    def setUp(self):
        TimeSideTestServer.setUp(self)
        request_providers = self.client.get('/timeside/api/providers/', format='json')
        for provider in request_providers.data:
            if provider['pid'] == 'youtube':
                self.youtube_uuid = provider['uuid']
            if provider['pid'] == 'deezer':
                self.deezer_uuid = provider['uuid']
        
       
    def testProviderYoutubeFromURI(self):
        """ test item creation with youtube's MJ 'Beat It' track's URI """

        params = {'title':'Beat It',
                'description':'Music from <NAME>',
{'fraction_non_alphanumeric': 0.11452513966480447, 'fraction_numerical': 0.0, 'mean_word_length': 2.783450704225352, 'pattern_counts': {'":': 0, '<': 6, '<?xml version=': 0, '>': 6, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 1, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3209963', 'n_tokens_mistral': 601, 'n_tokens_neox': 572, 'n_words': 138}