How to use selenium to access web database in Django?

Viewed 39

I am running a Django website using the given dev server command

./manage.py runserver

The website contains a submission form with the textfield "title" and a submit button. Once the button is clicked, the input is saved as an object in the Titles table initialized by the following Django model:

class Title(models.Model):
    id = models.IntegerField(primary_key=True)
    title = models.CharField(max_length=200, unique=True)

I am testing on Python to see if the input is actually saved as an object in the table by using django.test.TestCase and selenium webdriver to write a title and click submit. The problem is that I don't know how to access the objects in the datatable afterwards. Is there a way to access the datatables on the servers using a test method?

I am using sqllite for the database.

0 Answers
Related