I have a django application with all js and jquery modules embedded in django templates between 'script' tags,
{% extends "myfile/base.html" %}
{% load static %}
{% block content %}
<!doctype html>
<html>
<body>
<h2>Welcome</h2>
<button id="mybtn" ></button>
</body>
<script type="text/javascript">
$("#mybtn").on("click",function(){
//process some user data
//manipulate DOM elements
}
function myFun(par1,par2){
return par1+par2;
}
</script>
</html>
{% endblock %}
i wanted to write Unit Test cases for the above jquery and js functions, is it possible to do with this kind of template or do i need to separate the js from this template in to a '.js' file,and load that js in to this template? Is it valid to perform UT for js in django?