Skip to content

Commit

Permalink
[Update] - Added one testcase for Landlords
Browse files Browse the repository at this point in the history
  • Loading branch information
mojalefakodisang committed Jun 12, 2024
1 parent fd5d378 commit 851fca7
Showing 1 changed file with 20 additions and 1 deletion.
21 changes: 20 additions & 1 deletion backend/landlords/tests.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,22 @@
from rest_framework.test import APIClient
from django.test import TestCase
from rest_framework import status
from django.urls import reverse
from .models import Landlord

# Create your tests here.

class LandlordAPITestCase(TestCase):
def setUp(self):
self.client = APIClient()
self.register_url = reverse('landlord-register')
self.login_url = reverse('landlord-login')

self.user_data = {
'email': '[email protected]',
'password': 'my_password'
}

def test_register(self):
response = self.client.post(self.register_url, self.user_data, format='json')
self.assertEqual(response.status_code, status.HTTP_201_CREATED)

0 comments on commit 851fca7

Please sign in to comment.