25 lines
687 B
Python
25 lines
687 B
Python
import json
|
|
from os import listdir
|
|
|
|
from django.test import Client, TestCase
|
|
from django.contrib.staticfiles import finders
|
|
|
|
# Create your tests here.
|
|
|
|
class DictionnariesTest(TestCase):
|
|
def setUp(self) -> None:
|
|
self.client = Client();
|
|
self.directory = finders.find('js/lang/');
|
|
|
|
def test_lang(self):
|
|
keys = None
|
|
|
|
json_files = listdir(self.directory);
|
|
for file in json_files:
|
|
with open(f'{self.directory}/{file}') as f:
|
|
data: dict = json.load(f);
|
|
if (keys is None):
|
|
keys = set(data.keys());
|
|
else:
|
|
self.assertEqual(set(data.keys()), keys);
|