Skip to content

Commit

Permalink
Refactor database settings and admin model
Browse files Browse the repository at this point in the history
  • Loading branch information
FeloxleF committed Mar 18, 2024
1 parent 54626bd commit 3a42d4d
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 14 deletions.
12 changes: 0 additions & 12 deletions activmindback/activmindback/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,18 +100,6 @@
'init_command': "SET default_storage_engine=INNODB",
'collation': 'utf8mb4_general_ci',
},
},
'test': {
'ENGINE': 'django.db.backends.mysql',
'NAME': 'activmind_test',
'HOST': MYSQL_HOST,
'USER': 'root',
'PASSWORD': 'root',
'OPTIONS': {
'charset': 'utf8mb4',
'init_command': "SET default_storage_engine=INNODB",
'collation': 'utf8mb4_general_ci',
},
}
}

Expand Down
5 changes: 4 additions & 1 deletion activmindback/core/admin.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
from django.contrib import admin
from rest_framework.authtoken.models import Token

class TokenAdmin(admin.ModelAdmin):
search_fields = ('email',) # Ajoutez les champs que vous souhaitez utiliser pour la recherche

search_fields = ('email',) # Ajoutez les champs que vous souhaitez utiliser pour la recherche
# Enregistrez le modèle Token avec TokenAdmin
admin.site.register(Token, TokenAdmin)

2 changes: 1 addition & 1 deletion activmindback/tasks/tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ class TasksViewSetTestCase(APITestCase):
def setUp(self):
self.user = User.objects.create_user(email='[email protected]', password='password12345', user_type='P')
self.user_info = UserInfo.objects.create(user=self.user, first_name='John', last_name='Doe', date_of_birth='1990-01-01')
self.client.force_login(self.user)
# self.client.force_login(self.user)
self.task = Task.objects.create(user_id=self.user.id, title='Test Task 1', discription='Test Description 1', do_date='2024-03-22', start_time='10:00:00', end_time='12:00:00', repetation=False, alarm=True)
print(" prems le id est" + str(self.task.id))

Expand Down

0 comments on commit 3a42d4d

Please sign in to comment.